我有一个问题,我想获取那些包含缺失值的行。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 ×1