I have gone through several posts and they either only apply to examples with one column, or with only NaN or 0 values - but not both.
My df looks like this. I would like to fill-in column 'Main' with the non-missing or non-zero string found in the four columns right to it.
current df =
import pandas as pd
d = {'Main': ['','','',''], 'col2': ['Big','','',0], 'col3': [0,'Medium',0,''], 'col4': ['','','Small',''], 'col5':['',0,'','Vsmall']}
df = pd.DataFrame(data=d)
+------+------+--------+-------+--------+
| Main | Col2 | Col3 | Col4 | Col5 |
+------+------+--------+-------+--------+
| | Big | 0 | ... | |
+------+------+--------+-------+--------+
| | ... | Medium | ... | 0 |
+------+------+--------+-------+--------+
| | | 0 | Small | |
+------+------+--------+-------+--------+
| | 0 | ... | ... | Vsmall |
+------+------+--------+-------+--------+
desired output df
+--------+------+--------+-------+--------+
| Main | Col2 | Col3 | Col4 | Col5 |
+--------+------+--------+-------+--------+
| Big | Big | 0 | ... | |
+--------+------+--------+-------+--------+
| Medium | ... | Medium | ... | 0 |
+--------+------+--------+-------+--------+
| Small | | 0 | Small | |
+--------+------+--------+-------+--------+
| Vsmall | 0 | ... | ... | Vsmall |
+--------+------+--------+-------+--------+
Thanks in advance!