how to remove nan values from dataframe in python code example
Example 1: how to delete nan values in python
x = x[~numpy.isnan(x)]
Example 2: dropping nan in pandas dataframe
df.dropna(subset=['name', 'born'])
Example 3: drop columns with nan pandas
>>> df.dropna(axis='columns')
name
0 Alfred
1 Batman
2 Catwoman