Given below is my current pandas DataFrame:
Balance before Salary Salary
Month
Jun-18 27.20 15300.0
Jul-18 88.20 15300.0
Aug-18 176.48 14783.0
Sep-18 48.48 16249.0
Oct-18 241.48 14448.0
Nov-18 49.48 15663.0
is it possible to convert the above DataFrame in the below format?
Month1 Month2 Month3 Month4 Month5 Month6
Balance before Salary 27.2 88.2 176.48 48.48 241.48 49.48
Salary 15300 15300 14783 16249 14448 15663
Code
df = pd.DataFrame(salary_List)
newdf = df.groupby('date').sum()
newdf = df.groupby(pd.Grouper(key='date', freq='1M')).sum()
newdf.index = newdf.index.strftime('%b-%y')
newdf.index.name = 'Month'
Can anyone please help me on this?

transpose?df = df.T?