I have a timeseries stored in a dataframe and would like to extract the latest non NAN value per column and store it in a single-row dataframe.
So my datraframe looks as follows:
data={ 'col1' : [np.nan,np.nan,3], 'col2' : [1,np.nan,np.nan],'col3' : [np.nan,3,np.nan]}
df = pd.DataFrame(data,index=pd.bdate_range(start='01.01.2020',end='01.05.2020'))
And my desired output should be sth. like:
col1 col2 col3
0 3 1 3