Skip to content

Instantly share code, notes, and snippets.

@minhkstn
Last active April 20, 2022 20:47
Show Gist options
  • Save minhkstn/931802a344ee056c92b980058cba23af to your computer and use it in GitHub Desktop.
Save minhkstn/931802a344ee056c92b980058cba23af to your computer and use it in GitHub Desktop.
# import necessary libraries
import pandas as pd
import matplotlib.pyplot as plt
# get input data
df = pd.read_csv('./data.csv')
ax = df.plot(x='Year', y='Item 1',
kind='bar')
ax.set_ylabel("Price (USD)")
for container in ax.containers:
ax.bar_label(container)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment