gpt4 book ai didi

python - FutureWarning in using iteritems() in use .iloc() pandas

转载 作者:行者123 更新时间:2023-12-05 04:20:30 28 4
gpt4 key购买 nike

temp2 DataFrame

当我在 .iloc 中使用 s.iteritems() 时,我看到以下警告:

FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead. for item in s.iteritems()

当我使用这个功能时:

temp3 = temp2.iloc[:, 0]

我正在使用 python 3.8,但不知道为什么会收到此警告。

我还尝试了以下方法:

temp3 = temp2.iloc[:, 0].copy()
temp3 = temp2.loc[:, 0].copy()
temp3 = temp2[0].copy()

但都是一样的

最佳答案

顺便说一句,我解决了我的问题:

temp3 = temp2[0].values

但我不知道为什么会收到此警告!

关于python - FutureWarning in using iteritems() in use .iloc() pandas,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74442073/

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