Skip to content

Instantly share code, notes, and snippets.

@StephenFordham
Created April 13, 2021 10:46
Show Gist options
  • Save StephenFordham/9f8b134b7c83eea68e87b823f49e31de to your computer and use it in GitHub Desktop.
Save StephenFordham/9f8b134b7c83eea68e87b823f49e31de to your computer and use it in GitHub Desktop.
antibiotic_resistance_mapping
res = pd.read_csv('resistance_score__Country__res_0-3_vir_0-5.csv')
res['resistance_scores'] = res['annotation'].apply(lambda x: int(x[0]))
res.drop('annotation', axis=1, inplace=True)
res.columns = ['country', 'resistance_scores']
res.groupby('country').mean()['resistance_scores'].sort_values(ascending=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment