gpt4 book ai didi

python - FutureWarning : In a future version of pandas all arguments of DataFrame. any 和 Series.any 将仅包含关键字

转载 作者:行者123 更新时间:2023-12-03 08:02:08 25 4
gpt4 key购买 nike

这是产生问题的 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com