xxxxxxxxxx
# Drop rows which contain any NaN value in the selected columns
mod_df = df.dropna( how='any',
subset=['Name', 'Age'])
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
# Drop rows that contain missing data and update the DataFrame.
data = data.dropna(axis=0)
# Confirm the data contains no missing values.
data.isnull().sum(axis=0)
xxxxxxxxxx
df = df[pd.notnull(df['RespondentID'])]
# Drop the missing value present in the "RespondentID" column
xxxxxxxxxx
# Drop only rows from the dataframe where value of column A is missing
# Other rows will remain even if other columns have missing values as long as column A has no missing value
df.dropna(subset=['A'], inplace=True)