# 2023-03-28-NCL ### This document: # https://hackmd.io/@rseteam-ncl/2023-03-28-NCL ### JupyterHub: # https://jupyter.ncldata.dev ### Links: - [Workshop website](https://nclrse-training.github.io/2023-03-28-NCL/) - [Code of Conduct](https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html) - [Link to data](https://github.com/carpentries-incubator/python-novice-programming-gapminder/raw/main/files/python-novice-gapminder-data.zip) - [Pre-workshop survey](https://carpentries.typeform.com/to/wi32rS?slug=2023-03-28-NCL) - [Post-workshop survey](https://carpentries.typeform.com/to/UgVdRQ?slug=2023-03-28-NCL) ### Attendance - Please sign in with your university email 1. e.o.utuk2@ncl.ac.uk 3. s.hopper@newcastle.ac.uk 4. C0073744@newcastle.ac.uk 5. njm396@ncl.ac.uk 6. david.halliday@newcastle.ac.uk 7. Asma Feriel Khoualdi 8. c0078612@ncl.ac.uk 9. x.yu25@newcastle.ac.uk 10. P.Trus2@newcastle.ac.uk 11. g.amicarelli@newcastle.ac.uk 12. i.o.aghedo2@newcastle.ac.uk 13. y.zheng26@newcastle.ac.uk 14. o.g.g.awf2@newcastle.ac.uk 15. b9036125@newcastle.ac.uk ```import glob import pandas as pd import matplotlib.pyplot as plt fig, ax = plt.subplots(1,1) for filename in glob.glob('data/gapminder_gdp*.csv'): dataframe = pd.read_csv(filename) # extract {region} from the filename, expected to be in the format 'data/gapminder_gdp_{region}.csv'. # we will split the string using the split method and `_` as our separator, # retrieve the last string in the list that split returns (`{region}.csv`), # and then remove the `.csv` extension from that string. region = filename.split('_')[-1][:-4] dataframe.mean().plot(ax=ax, label=region) plt.legend() plt.show() ```