I get this error when running the code below 'Can't assign to operator'
df_2 = pd.pivot_table(df, index = df.columns[~df.columns.str.startswith('A')],
values = df.columns[ df.columns.str.startswith('A')])
I want to aggregate on all columns that doesn't start with A, and write all data in columns that do start with A following the advise from here:
How to groupby and pivot a dataframe with non-numeric values
Any help will be greatly appreciated.