Eli*_*101 7 python pandas future-warning
当尝试使用 pandas 模块在 python 中运行该corr()方法时,出现以下错误:
FutureWarning: The default value of numeric_only in DataFrame.corr is deprecated. In a future version, it will default to False. Select only valid columns or specify the value of numeric_only to silence this warning.
print(df.corr())
Run Code Online (Sandbox Code Playgroud)
注意(只是为了澄清):-df是从 a 读取的数据帧的名称csv。
例如:-
import pandas as pd
df = pd.read_csv('Data.csv')
print(df.corr())
Run Code Online (Sandbox Code Playgroud)
问题仅在于corr()引发上述错误的方法:
FutureWarning: The default value of numeric_only in DataFrame.corr is deprecated. In a future version, it will default to False. Select only valid columns or specify the value of numeric_only to silence this warning.
Run Code Online (Sandbox Code Playgroud)
我部分理解该错误,但我想知道:
是否有其他替代方法可以执行相同的功能
corr()来识别数据集中每列之间的关系?就像有没有一种方法可以在不使用方法的情况下复制函数corr()?
抱歉,如果我的问题是错误或不恰当的,我愿意接受反馈。
提前致谢。
| 归档时间: |
|
| 查看次数: |
17461 次 |
| 最近记录: |