Home > OS >  How to use the data from csv file to Matplotlib Bar Chart in jupyter
How to use the data from csv file to Matplotlib Bar Chart in jupyter

Time:05-01

Could someone help me with how to create a bar graph in python using a CSV file? I want to plot a bar graph with the x-axis as ReleaseMonth and the y-axis with Rating, which I can interpret which month has the highest rating from the bar graph.

Below is my data head:

enter image description here

CodePudding user response:

import seaborn as sns

ax = sns.barplot(x="ReleaseMonth", y="Rating", data=df)
plt.show()

CodePudding user response:

x_release_month = df["ReleaseMonth"]
y_rating = df["Rating"]

# setting the size of the figure
fig = plt.figure(figsize=(10,5))

#bar plot
plt.bar(x_release_month, y_rating)
plt.show()
  • Related