I have a data-frame in which I keep all my relevant attributes and another one which has attributes based on which I want to group the first df.
I know you can groupby the data-frame if you put a series(one column) as an argument, by if you put a data-frame you get an error.
ValueError: Grouper for '<class 'pandas.core.frame.DataFrame'>' not 1-dimensional
I know I could just concat the columns to the original data-frame, but I would prefer not to, unless there is no other solution.
df.groupby([sorted_team_names]).ngroup()
This is my code. sorted_team_names is a df with two columns, furthermore it has the same index as df.
It is a rather general question, I am not sure you need a data-sample.