作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是产生问题的 Python 语句:
nan_rows = df[df.isnull().any(1)]
并且它给出以下警告:
FutureWarning: In a future version of pandas all arguments of DataFrame.any and Series.any will be keyword-only.
这是来自生产环境的警告。很抱歉,我无法分享完整的代码,因为解决这个问题相当复杂。
我如何理解这个警告的含义,以及我应该如何更新这行代码?
最佳答案
从 pandas 1.5 开始,您会收到 FutureWarning
。
您必须指定axis=1
:
nan_rows = df[df.isnull().any(axis=1)]
在未来的版本中,仅接受关键字参数,省略关键字将引发错误。
关于python - FutureWarning : In a future version of pandas all arguments of DataFrame. any 和 Series.any 将仅包含关键字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73813602/
我是一名优秀的程序员,十分优秀!