how to convert multiple columns into single columns in pandas?
Let's say you have the following data:

import pandas as pd
import numpy as np
df = pd.DataFrame({'values': ['1', '2', '3', '4', '5', '6'],
                  'month1': ['January', 'March', np.nan, np.nan, np.nan, np.nan],
                  'month2': [np.nan, np.nan, 'February', 'April', np.nan, np.nan],
                  'month3': [np.nan, np.nan, np.nan, np.nan, 'May', 'October']})

  values   month1    month2   month3
0      1  January       NaN      NaN
1      2    March       NaN      NaN
2      3      NaN  February      NaN
3      4      NaN     April      NaN
4      5      NaN       NaN      May
5      6      NaN       NaN  October


You can use the following solution:

df['month']=np.nan
for month in [col for col in df.columns if 'month' in col]:
    df['month'].fillna(df[month],inplace=True)


It first creates an empty column named "month" with NaN values, and you fill the NaN with the values from the "monthX" columns, concretely it gives you:

  values   month1    month2   month3     month
0      1  January       NaN      NaN   January
1      2    March       NaN      NaN     March
2      3      NaN  February      NaN  February
3      4      NaN     April      NaN     April
4      5      NaN       NaN      May       May
5      6      NaN       NaN  October   October