'The Bar Chart In Python

I am new to Python and working on a bar chart of a csv file. This bar chart is about the number of Tornadoes in different months. The x-axis should be the months (1-12)and the y-axis should be the number of tornadoes in each months. However, I do not know how to count the number of tornadoes in each months(For exmaple, how many times does the element "January" appeared in this file?). Is there any one can give me some hints? Here is my code:

import matplotlib.pyplot as plt
import pandas as pd
df = pd.DataFrame(tdata)
X = list(df.iloc[:,2])
Y = df.index("mo")
plt.bar(X,Y,color="g")
plt.title("Number of Tornadoes in 12 Months")
plt.xlabel("Months")
plt.ylabel("Number of Tornadoes")

I cannot uplod the file, but it looks like this: enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source