remove columns if all values Nan pd code example
Example 1: python remove nan rows
df = df[df['my_var'].notna()]
Example 2: drop column with nan values
fish_frame = fish_frame.dropna(axis = 1, how = 'all')
df = df[df['my_var'].notna()]
fish_frame = fish_frame.dropna(axis = 1, how = 'all')