I have a Pandas Dataframe with at least 4 non-NaN values on each row, but located at different columns:
Index Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8
1991-12-31 100.000 100.000 100.000 89.123 NaN NaN NaN NaN
1992-01-31 98.300 101.530 100.000 NaN 92.342 NaN NaN NaN
1992-02-29 NaN 100.230 98.713 97.602 NaN NaN NaN NaN
1992-03-31 NaN NaN 102.060 93.473 98.123 NaN NaN NaN
1992-04-30 NaN 102.205 107.755 94.529 94.529 NaN NaN NaN
(I show only the first 8 columns) I would like to turn this into a Data frame with 4 columns for each row. The rows should contain only the first four (reading from left to right) non NaN values for that date.
Edit:
The order on each row matters.