In [1]:
import pandas as pd
In [2]:
%pylab inline
In [4]:
plt.style.use('ggplot')
#Some default stuff for my plotting
aspect_mult = 0.9
figsize(aspect_mult*16,aspect_mult*9)
linewidth = 3
In [5]:
df = pd.read_csv("data/universities_2017.csv")
In [6]:
df.head()
Out[6]:
In [7]:
result = df.groupby('University').size()
In [8]:
result.sort_index()
Out[8]:
In [9]:
result
Out[9]:
In [10]:
result.keys()
Out[10]:
In [11]:
plt.barh(range(result.shape[0]),result.values)
plt.yticks(np.arange(result.shape[0])+0.4,result.keys(), rotation=0,fontsize=14)
plt.xlim(0,max(result)+1)
plt.title("DSIDE 2017/2018 University Representation",fontsize=18, color = 'k')
plt.ylabel("Universities",fontsize=16, color = 'k')
plt.xlabel("Number of Students",fontsize=16, color = 'k')
pyplot.savefig('../images/2017-universities.png',bbox_inches='tight')
In [ ]: