edn*_*edn 2 python dataframe python-3.x pandas
以下是产生问题的 Python 语句:
nan_rows = df[df.isnull().any(1)]
Run Code Online (Sandbox Code Playgroud)
并且它给出了以下警告:
FutureWarning: In a future version of pandas all arguments of DataFrame.any and Series.any will be keyword-only.
Run Code Online (Sandbox Code Playgroud)
这是来自生产环境的警告。很抱歉,我无法分享完整的代码,因为解决这个问题相当复杂。
我怎样才能理解这个警告的意思,以及我应该如何更新这行代码?
从 pandas 1.5 开始,你会得到一个FutureWarning.
您必须指定axis=1:
nan_rows = df[df.isnull().any(axis=1)]
Run Code Online (Sandbox Code Playgroud)
在未来的版本中,仅接受关键字参数,省略关键字将引发错误。
| 归档时间: |
|
| 查看次数: |
2438 次 |
| 最近记录: |