Reputation: 67
I'm trying to locate all rows that have N/A for a particular column, however my code isn't working...
df_train.iloc[lambda x: x.value.isna()]
Upvotes: 0
Views: 571
Reputation: 201
try:
df_train.loc[df_train.value.isna()]
If you really want to do it with iloc
try next one:
df_train.iloc[lambda x: x[x.value.isna()].index]
This is needed because iloc
is a purely index-based selection.
Upvotes: 2
Reputation: 2757
You are almost there! loc
does take callable with a boolean return, so you can do
df_train.loc[lambda x: x.value.isna()]
Upvotes: 0