I\'m have the following code which creates a table and a barplot via seaborn.
#Building a dataframe grouped by the # of Engagement Types
sales_type = sales.g
Something to add to @w-m's answer.
If you are adding multiple columns from one dataframe to another:
df1[['col1', 'col2']] = df2[['col1', 'col2']]
it will create a multi-column index and if you try to group by anything on df1
, it will give you this error.
To solve this, get rid of the multi-index by using
df1.columns = df1.columns.get_level_values(0)