import matplotlib.pyplot as plt
x = ['Eric','Jhon','bill','Daniel']
y = [10, 17, 12.5, 20]
plt.plot(x,y)
plt.show()
When I run this code, I get this error
ValueError: could not convert string to float:
I want all names in list x
at x-axis and corresponding ages are in second list y
which will be used in bar graph.
So here I have 1 more question Is it a good way to do in my case(I mean if we can create a list of tuples(name,age)) and that would be easy?? or something else.