pandas df i want to drop all nans and move data up together code example
Example 1: dropping nan in pandas dataframe
df.dropna(subset=['name', 'born'])
Example 2: drop columns with nan pandas
>>> df.dropna(axis='columns')
name
0 Alfred
1 Batman
2 Catwoman