remove rows which have na in python code example
Example 1: how to delete na values in a dataframe
# if you want to delete rows containing NA values
df.dropna(inplace=True)
Example 2: dropping nan in pandas dataframe
df.dropna(subset=['name', 'born'])
Example 3: python remove nan rows
df = df[df['my_var'].notna()]
Example 4: delete nans in df python
df[~np.isnan(df)]