I am attempting to drop the nan
values in my DataFrame df
, however I am having difficulty in dropping the for each column without effecting the entire row. An example of my df
can be seen below.
Advertising No Advertising
nan 7.0
71.0 nan
65.0 nan
14.0 nan
76.0 nan
nan 36.0
nan 9.0
73.0 nan
85.0 nan
17.0 nan
nan 103.0
My desired output is shown below.
Advertising No Advertising
71.0 7.0
65.0 36.0
14.0 9.0
76.0 103.0
73.0
85.0
17.0
The examples given are just a snippet of the total DataFrame.
Any help would be greatly appreciated.