My data is a Data Frame with retail items and their sales performance. Columns include: 2016 unit sales, 2015 unit sales, item description, etc. When I try to do a groupby for brand:
Data.groupby(by="Major Brand").sum()
I get the following error: TypeError: unorderable types: int() < str()
I assume this is because not all of the data in the DataFrame are numbers therefore pandas doesn't know how to 'sum'.
But I can get individual groupby's using something like:
Data.groupby(by="Major Brand")["2016 Units"].sum()
Ultimately I just want to group by "Major Brand" and compare "2016 Units" to "2015 Units" and put all three them into a new DataFrame with the "Major Brand" as the index.
I have tried merging my multiple groupby's together but that never seems to work.
Thank you!