【问题标题】:Using iloc but FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead. for item in s.iteritems()使用 iloc 但 FutureWarning: iteritems 已弃用,将在未来版本中删除。请改用 .items。对于 s.iteritems() 中的项目
【发布时间】:2022-11-15 16:12:28
【问题描述】:

temp2 DataFrame

我看到FutureWarning:不推荐使用 iteritems,并将在未来的版本中删除。请改用 .items。对于 s.iteritems() 中的项目使用此功能时发出警告:

temp3 = temp2.iloc[:, 0]

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

我也试过

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

但它是一样的。

【问题讨论】:

    标签: python


    【解决方案1】:

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

    temp3 = temp2[0].values
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-29
      • 2019-02-28
      • 2018-12-21
      • 1970-01-01
      • 2021-04-12
      相关资源
      最近更新 更多