【问题标题】:How to find where is the error value in the Panda Dataframe如何查找 Panda Dataframe 中的错误值在哪里
【发布时间】:2020-10-25 10:38:37
【问题描述】:
C:\New folder\lib\site-packages\numpy\core\_asarray.py in asarray(a, dtype, order)
     83 
     84     """
---> 85     return array(a, dtype, copy=False, order=order)
     86 
     87 

ValueError: could not convert string to float: '3 2'

如何在我的数据集中找到此错误“3 2”值的位置?

【问题讨论】:

    标签: python pandas numpy machine-learning


    【解决方案1】:

    你可以使用相等比较

    df.isin(["3 2"]).any()

    如果你需要坐标,那么

    df[df.isin(["3 2"])].stack()

    【讨论】:

      猜你喜欢
      • 2023-03-10
      • 1970-01-01
      • 1970-01-01
      • 2020-04-15
      • 1970-01-01
      • 1970-01-01
      • 2023-02-09
      • 1970-01-01
      • 2019-01-21
      相关资源
      最近更新 更多