Skip to content

Instantly share code, notes, and snippets.

@anirudhpillai
Created September 5, 2017 10:31
Show Gist options
  • Save anirudhpillai/be6da678a04102929f846b5fbefe2a2d to your computer and use it in GitHub Desktop.
Save anirudhpillai/be6da678a04102929f846b5fbefe2a2d to your computer and use it in GitHub Desktop.
import pandas
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
matplotlib.style.use('ggplot')
df = pandas.read_excel('results.xls')
df.set_index("Candidate Number", inplace=True)
df['Overall'] = df.mean(axis=1)
# print(df.head())
pp = PdfPages('results.pdf')
for col in df:
figure = df[col].plot(
bins=list(range(0, 101, 10)),
kind='hist',
legend=True,)
pp.savefig()
plt.clf()
pp.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment