I have a dataframe df
and one of the features called mort_acc
have missing data. I want to filter out those rows that contains missing data for mort_acc
and I used the following way
df[df['mort_acc'].apply(lambda x:x == " ")]
It didn't work. I got output 0
. So I used the following lambda way
df[df['mort_acc'].apply(lambda x:len(x)<0)]
It didn't work too and this time got error object of type 'float' has no len()
So I tried this way
df[df['mort_acc'].apply(lambda x:x == NaN)]
Error happened again name 'NaN' is not defined
Does anyone know how to do it?