Commit 4966439d authored by Mickael Lalande's avatar Mickael Lalande Committed by Didier Voisin
Browse files

Include WHO application in TP1 + update TP2

parent 5a095242
......@@ -944,9 +944,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.5"
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
......@@ -580,8 +580,53 @@
%% Cell type:markdown id: tags:
### 3.7. Resample, check WHO air quality and share your plots!
The problem with the hourly frequency is that you don't see much. In order to better visualize the data, we can use the `resample` function (, which allows us to rescale our data by day (`'D'`), month (`'M'`) or year (`'Y'`).
1. **Try to use this function visualize the data at different frequencies.**
2. **Choose a station and a pollutant, and try to check if the WHO recommendations are respected** (,than%203%20times%20a%20year.)
%% Cell type:code id: tags:
``` python
# your input here
%% Cell type:markdown id: tags:
### 3.8. Share your plots!
1. Go to
2. Choose a station and a pollutant by putting a note with your name in a cell that has not yet been chosen
3. Adapt the code bellow to produce your figure, then save it and share it on the whiteboard to compare with other pollutants/stations!
NB: Choose a frequency consistent with the WHO recommendations, and a time period that allow to see what time of the year the levels are above WHO recommended guidelines.
%% Cell type:code id: tags:
``` python
# Modify the following code
station = 'Campus'
polluant = 'NO2'
start = '2012'
stop = '2016'
df[station, polluant][start:stop].resample('D').mean().plot(label=polluant)
plt.hlines(y=25, xmin=start, xmax=stop, color='crimson', label='WHO guideline', zorder=10)
plt.ylabel(polluant+ ' [µg/m3]')
# plt.savefig(station+'_'+polluant+'_'+start+'-'+stop+'.jpg', dpi=300)
%% Cell type:markdown id: tags:
### conclusion of part 1
how do you like pandas so far ?
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment