I try to plot a simple barplot in Python, but when I run the code:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
x=['A','B','C','D','E','F','G','H','I','J']
y=[47, 23, 27, 0, 82, 7, 46, 92, 36, 76]
plt.bar(x,y)
plt.xlabel('Categories')
plt.ylabel("Values")
plt.title('Categories Bar Plot')
plt.show()
I get an error message:
ValueError: could not convert string to float: 'A'
I don't know why this does not work, especially because it's an exact copy of an example from a website which should work.
