Skip to content

Commit e46f8c5

Browse files
Add an exercise to search for stations and make lookups.
1 parent 5429880 commit e46f8c5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

climate_timeseries/climate_timeseries-Part2.ipynb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,18 @@
270270
"print(giss_temp.loc[1979, \"Dec\"])"
271271
]
272272
},
273+
{
274+
"cell_type": "code",
275+
"execution_count": null,
276+
"metadata": {
277+
"collapsed": false
278+
},
279+
"outputs": [],
280+
"source": [
281+
"# the loc operators support fancy indexing:\n",
282+
"print(giss_temp.loc[1979, [\"Nov\", \"Dec\"])"
283+
]
284+
},
273285
{
274286
"cell_type": "code",
275287
"execution_count": null,
@@ -352,6 +364,15 @@
352364
"local_sea_level_stations.loc[american_stations, [\"ID\", \"Station Name\"]]"
353365
]
354366
},
367+
{
368+
"cell_type": "markdown",
369+
"metadata": {},
370+
"source": [
371+
"**EXERCISE**: Print all European countries that have sea level stations. We will for now define Europe as being a country that has a station within the 30-70 latitude and a longitude in -10 to 40. You will need to combine masks using the `&` (`and`) and/or the `|` (`or`) operators, just like in Numpy.\n",
372+
"\n",
373+
"Bonus: print each country only once."
374+
]
375+
},
355376
{
356377
"cell_type": "markdown",
357378
"metadata": {},

0 commit comments

Comments
 (0)