xxxxxxxxxx
# remove all rows without a value in the 'name' column
df = df[df['name'].notna()]
xxxxxxxxxx
# making new data frame with dropped NA values
new_data = df.dropna(axis = 0, how ='any')
xxxxxxxxxx
df.dropna() #drop all rows that have any NaN values
df.dropna(how='all')
xxxxxxxxxx
# Drop rows which contain any NaN value in the selected columns
mod_df = df.dropna( how='any',
subset=['Name', 'Age'])
xxxxxxxxxx
df = df[pd.notnull(df['RespondentID'])]
# Drop the missing value present in the "RespondentID" column
xxxxxxxxxx
In [215]:
df[df['entrytype'].apply(lambda x: str(x).isdigit())]
Out[215]:
entrytype
0 0
1 1
4 2