why am I getting the valueError while sentimental analysis?

34 Views Asked by At

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'}]]
0

There are 0 best solutions below