I have 12 columns, each labeled 1-12 that are representing months. Some columns have a data reading, and others are blank (nan). I need to have a new column that displays the first month with a reading. I also need another column that displays the last column with a reading.
Right now I have tried:
df['df_initial_month] = first_valid_index()
In the very first column I have "ID's" that I would like to skip. Right now when I run the code it just displays the first ID in every single row of the new column
I have also tried using
df.ffill(axis=1).iloc[:,0]