Created
October 8, 2018 22:22
-
-
Save manodeep/f79a00e8ce5b1537560309c3e2ce01c6 to your computer and use it in GitHub Desktop.
Jupyter Notebook for RSE Expression of Interest Survey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import seaborn as sns | |
import pandas as pd | |
import warnings | |
import matplotlib.pyplot as plt; | |
import matplotlib; | |
matplotlib.style.use('ggplot'); | |
txtfile='RSE-EOI-survey-list-anonymized-v2.csv' | |
rse_df = pd.read_csv(txtfile, | |
delimiter=',', | |
index_col=False) | |
rse_df['Degree'].fillna(rse_df.OtherDegree, inplace=True) | |
rse_df['Priority'].fillna(value='Other', inplace=True) | |
del rse_df['OtherDegree'] | |
del rse_df['OtherPriority'] | |
%matplotlib inline | |
figsize=(8,8); | |
fontsize=32; | |
plt.figure(figsize=figsize); | |
rse_df.Degree.unique() | |
rse_df.Degree.value_counts() | |
pd.value_counts(rse_df['Degree']) | |
pd.value_counts(rse_df['Degree']).plot(kind='pie',autopct='%0.1f', figsize=figsize, fontsize=fontsize); | |
replace_values = {'More long-term career options within research community': 'Long-term career pathways in research', | |
'Increased opportunities to meet and interact with other RSEs': 'Interactions with other RSEs', | |
'Increased recognition for the importance of the RSE role': 'Recognition for RSEs', | |
'Sharing of best practices and new technologies with other RSEs': 'Sharing best-practices'} | |
rse_df['Priority'].replace(replace_values, inplace=True) | |
matplotlib.rcParams['text.usetex'] = False | |
pd.value_counts(rse_df['Priority']).plot(kind='pie',label='', figsize=figsize,colormap='Set2', autopct='%0.1f',fontsize=fontsize); | |
pri = sns.countplot(y="Priority", hue="Degree", data=rse_df, palette='muted') | |
plt.legend(loc='lower right'); | |
pri.figure.set_size_inches(figsize) | |
ax = pri.axes | |
for item in ([ax.title, ax.xaxis.label, ax.yaxis.label] + | |
ax.get_xticklabels() + ax.get_yticklabels()): | |
item.set_fontsize(fontsize) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment