0

I am trying to make a simple grouped bar chart like the following:

GroupedBarChart

It should be just a simple line of code:

table.hvplot.bar(stacked=False, height=500, rot=60).

I summarized my data into the table/df below ("ratings_df_sum"):

7   Online_THD_SKU                                  1_Star  2_Star  3_Star  4_Star  5_Star
0   1000017290-SG APC 640OZ                            3     0       1        1      6
1   1001700777-1 GAL. CONCENTRATED ALL-PURPOSE CLEA    5     4       3        45    289
2   1002075704-SMPL GRN OUTDR ODOR ELIMINATOR 32OZ    19     20      24       62    206
3   1002075713-SMPL GRN OUTDR ODOR ELIMINATOR 128OZ   33     17      28       93    305
4   1002332519-5 GAL. EXTREME AIRCRAFT AND PRECISIO   2      1       0        4     30
5   431429-SG APC 128OZ                               26     14      33      182    1242
6   435909-SG APC CONCEN SPY 32OZ                     12     0       5       6      88
7   853534-SG PRO HEAVY DUTY 128OZ                    24     6       11      29     187
8   854029-SG PRO3PLUS ANTIBAC&DISINFECT 128OZ        8      3       6       21     166
9   883387-SIMPLE GREEN APC 320OZ                     15     1       12      33     271

Essentially I'd like a group of bars for each SKU, each bar repsresenting counts for 1_Star, 2_Star, etc. When I run this line of code:

ratings_df_sum.hvplot.bar(stacked=False, height=500, rot=60)

I get this error:

TypeError: can only concatenate list (not "int") to list

Not sure what I'm doing wrong or how I can alter the df to be interpretable by hvplot? I am using hvplot because of the interactive capabilities. Any help would be immensely appreciated.

hvPlot documentation HERE

Thank you.

mexicanRmy
  • 69
  • 7
  • always put FULL error message (starting at word "Traceback") in question (not in comments) as text (not screenshot, not link to external portal). There are other useful information in the full error/traceback. – furas Oct 14 '22 at 10:08
  • if error shows you in which line is problem then first you could use `print()` to see what you have in variables before this line. It seems you have single integer instead of list of integers in one of the varaibles. – furas Oct 14 '22 at 10:09
  • better show minimal working code with example data directly in code - so we could simply copy and test it. – furas Oct 14 '22 at 10:12

0 Answers0