how to remove rows with null values in pandas code example
Example 1: if none in column remove row
import pandas as pd
df = df[pd.notnull(df['Gender'])]
Example 2: drop null rows pandas
df.dropna()
Example 3: dropping nan in pandas dataframe
df.dropna(subset=['name', 'born'])
Example 4: remove all rows without a value pandas
# Keeps only rows without a missing value
df = df[df['name'].notna()]