0

I was trying to do the sentimental analysis of amazon product reviews here and i was trying to get the pie chart and bar graph but got this error. not getting the pie chart and bargraph

ValueError                                Traceback (most recent call last)
<ipython-input-90-2089ce8a5ab8> in <module>
----> 1 categorical_variable_summary(df,"overall")

1 frames
<ipython-input-87-29535c4328ba> in categorical_variable_summary(df, column_name)
      3   fig = make_subplots(rows = 1, cols = 2,
      4                       subplot_titles=('Countplot', 'Percentage'),
----> 5                       specs=[[{'types' : 'xy'}],[{'types': 'domain'}]])
      6 
      7   fig.add_trace(go.Bar( y = df[column_name].value_counts().values.tolist(),

/usr/local/lib/python3.7/dist-packages/plotly/subplots.py in make_subplots(rows, cols, shared_xaxes, shared_yaxes, start_cell, print_grid, horizontal_spacing, vertical_spacing, subplot_titles, column_widths, row_heights, specs, insets, column_titles, row_titles, x_title, y_title, figure, **kwargs)
    448 dimensions ({rows} x {cols}).
    449     Received value of type {typ}: {val}""".format(
--> 450                 rows=rows, cols=cols, typ=type(specs), val=repr(specs)
    451             )
    452         )

ValueError: 
The 'specs' argument to make_subplots must be a 2D list of dictionaries with dimensions (1 x 2).
    Received value of type <class 'list'>: [[{'types': 'xy'}], [{'types': 'domain'}]]
Progman
  • 16,827
  • 6
  • 33
  • 48
  • Please provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). Also, see that you are passing a `list` instead of `dict` as the value. – Roxy Nov 15 '22 at 11:55
  • The issue is resolved actually i have been typing "types" instead of "type" that was giving me error thanks for your reply though – Yogesh Rajpurohit Nov 16 '22 at 13:33

0 Answers0