So I have data that looks like
Manufacturer Mean
0 DAF 57.036199
1 Fiat 42.296814
2 Ford 54.546769
3 Iveco 41.678711
4 MAN 50.764308
5 Mercedes Benz 49.093340
6 Renault 47.384080
7 Scania 46.317282
8 Volkswagen 50.938158
9 Volvo 43.382830
I am trying to plot a bar graph using the above data. I want the values above 48 to be coloured differently and the bottom 3 to be coloured differently. I tried using the code below but it gives me the following error:
TypeError: unsupported operand type(s) for -: 'str' and 'float'
The code I have written to make the graph:
plt.figure()
plt.bar(meansOfRoadGoingVehicles_sort['Manufacturer'], meansOfRoadGoingVehicles_sort['Mean'])
plt[0:7].set_color('b')
plt[6].set_color('grey')
plt[8:11].set_color('r')
plt.show()