This was my try. For example
df = pd.DataFrame({'a':[5,0,1,np.nan], 'b':[np.nan,1,4,3], 'c':[-3,-2,0,0]})
df.dropna(axis=1).max(axis=1,key=abs)
Filters out well the NaN
values but it gets 0 or negative values instead of the highes in absolute value
The result should be one column with
5
-2
4
3
dropna
you losing all columns withNaN
values and onlyc
column is left – Prissie