'error while visualization isinstance() arg 2 must be a type or tuple of types
i want to visualization how much negatif,neutral and positif from column sentiments but i got this error need help
my code
b = pd.value_counts(comment_df['sentiments'])
ax = b.plot.bar()
c = len(comment_df.index)
print(c)
for d in ax.patches:
ax.annotate(str(round(d.get_height() / c * 100, 2)) + '%', (d.get_x() * 1.005, d.get_height() * 1.005))
the error
TypeError Traceback (most recent call last)
<ipython-input-66-d1ee098bb533> in <module>()
1 b = pd.value_counts(comment_df['sentiments'])
----> 2 ax = b.plot.bar()
3 c = len(comment_df.index)
4 print(c)
5 for d in ax.patches:
9 frames
/usr/local/lib/python3.7/dist-packages/pandas/core/arraylike.py in <genexpr>(.0)
184
185 n_alignable = sum(isinstance(x, NDFrame) for x in inputs)
--> 186 n_frames = sum(isinstance(x, DataFrame) for x in inputs)
187
188 if n_alignable >= 2 and n_frames >= 1:
TypeError: isinstance() arg 2 must be a type or tuple of types
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


