小编Ank*_*ngh的帖子

整数类型上基于 iLocation 的布尔索引不可用

我有一个问题,我想获取那些包含缺失值的行。pd.isnull对表中的“里程”列使用 iloc 和。

import pandas as pd
df=pd.read_csv('BikeList.csv')
d1=df['Mileage']
print(d1)
print(pd.isnull(df['Mileage']))
d2=df.iloc[pd.isnull(df['Mileage']),['Bike','Mileage']]
Run Code Online (Sandbox Code Playgroud)

我有这个错误,

iLocation based boolean indexing on an integer type is not available
Run Code Online (Sandbox Code Playgroud)

import pandas as pd
df=pd.read_csv('BikeList.csv')
d1=df['Mileage']
print(d1)
print(pd.isnull(df['Mileage']))
d2=df.iloc[pd.isnull(df['Mileage']),['Bike','Mileage']]
Run Code Online (Sandbox Code Playgroud)

pandas

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

pandas ×1