返回特定行在python中具有空值的列

时间:2015-12-10 05:16:10

标签: python pandas indexing missing-data

如何在DataFrame中返回特定行缺少值的列(因为我稍后想要遍历这些行)? 例如,使用此

x=[[1,2,3],[5,np.NaN,4]]
df=pd.DataFrame(x)

我想要第二行有NaN的列我做了这个并且它有效但是必须有一个更优雅的方式吗?

df.iloc[:,np.where(df.iloc[1,:].isnull())[0]]

0 个答案:

没有答案
相关问题