I'm doing the udacity data science course. It's my first contact with programming, so do not judge the silly mistakes haha.
I am comparing two data frames with 2008 and 2018 year car information. One of the questions asks to compare the improvement in fuel consumption by vehicle class.
I took the consumption averages of each class using grupby, then threw those averages into a variable and tried to create a graph to compare the evolution from one year to the next. My attempt was this:
ind = np.arange(3, 7)
width = 0.2
labels = ['SUV', 'LC', 'MC', 'Minivan', 'Pickup', 'SC', 'SW']
bar_08 = plt.bar(ind, [18.47, 18.50, 21.60, 19.11, 16.27, 21.09, 22.36], width, color='r', label=2008)
bar_18 = plt.bar(ind+width, [17.19, 22.67, 26.90, 20.80, 18.08, 24.37, 27.52], width, color='b', label=2018)
location = ind+width/2
labels=labels
plt.xticks(locatio, labels)
plt.legend()
The error that appears is as follows: shape mismatch: objects can not be broadcast to a single shape
Can anyone enlighten me on this issue?