I have a dataframe where every row may have different numbers of columns. example of my df
column1 column2 column3 column4 column5 column6
row1 2 4 5
row2 3 4 5 6
row3 1 2 4 6
row4 2 3 5 7 8
row5 1 2 4 5 6
row6 2 3 4 7 8 9
row7 2 3 5 6 7 9
row8 3 4 6 8 9
row9 2 4 5 7 9 10
row10 4 7 6 9
row11 3 6 7 8 10 9
row12 4 6 8 9 11
row13 4 5 7 10 9 11
row14 5 6 9 11 10 12
For every row, how can I loop through every column that has a value with pandas?
Something like:
for index, row in df.iterrows():
#for every column that has a value
#do something with this column value of this row
Thanks