Python 筛选在df列中显示nan的行
我有一个有很多行的dfPython 筛选在df列中显示nan的行,python,pandas,Python,Pandas,我有一个有很多行的df Price Time Place A 5.1 11.30 germany B 4.1 08.30 lebannon ... DY 7.49 01.15 italy DZ 2.13 02.35 england 如何过滤df以获得列Price具有Nan 价值 到目前为止我试过了 df[~df['Price'
Price Time Place
A 5.1 11.30 germany
B 4.1 08.30 lebannon
...
DY 7.49 01.15 italy
DZ 2.13 02.35 england
如何过滤df以获得列Price
具有Nan
价值
到目前为止我试过了
df[~df['Price'].str.isnumeric()]
但是没有起作用
所需的输出如下:
Price Time Place
AS Nan 11.30 germany
BJ Nan 08.30 lebannon
使用
你也可以使用
尝试使用以下方法:
df = df.ix[df.price.isnull(),:]
或
df[np.isnan(df.Price.values)]
df = df.ix[df.price.isnull(),:]
df = df.loc[df.price.isnull(),:]