I’m trying to plot some csv data with python, but I’m getting ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
I’ve isolated the issue to x = df_bar.index for the bar plot, but I’m not sure how to fix it.
*Edit: I’ve also found out that I can’t call the month column into my plot
ax = sns.catplot(
x = df_bar.index, # this is the problem
y = 'value',
hue = 'month', # this is also a problem
kind = 'bar',
data = df_bar
)
I’m getting this same error in Mean-Var-STD calculator certification project. I’m not much help, but from looking at my code, I’m suspicious it may have something to do with numpy updating from 1.19.0 -> 1.19.1, as that value error seems to be associate with Numpy.
Or that could be super off! Hopefully someone with more knowledge will shed some light.
As it is right now hue = 'month' creates issues, because there’s no month column in your df_bar. month column was pulled in the index when .groupby() were called with as_index=True argument.
df_bar looks like
value
month
2016 5 19432.400000
6 21875.105263
(...)