Skip to content

Instantly share code, notes, and snippets.

@agung037
Last active March 4, 2022 03:31
Show Gist options
  • Select an option

  • Save agung037/b71e63096570e4593653dca49ceb4483 to your computer and use it in GitHub Desktop.

Select an option

Save agung037/b71e63096570e4593653dca49ceb4483 to your computer and use it in GitHub Desktop.

Simple Chart Using pandas and mathplotlib

alt text

import pandas as pd
import matplotlib.pyplot as plt
d = pd.read_excel('./data.xlsx')
data_by_genre = {}
for g in range(len(d['Genre'])):
data_by_genre[d['Genre'][g]] = list(d.loc[g][1:])
pd.DataFrame(data_by_genre, index=list(d.head(0))[1:]).plot.bar(rot=45).plot()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment