-
-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline exercises for notebooks 1, 2, 3, and 4 #15
base: master
Are you sure you want to change the base?
Conversation
@darribas sorry, didn't have time to look at this again. Do we still include it in the material for tomorrow? |
"source": [ | ||
"---\n", | ||
"\n", | ||
"**Exercise**: Which rivers pass within 1 degree of Paris? And for Hong Kong?\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would maybe do it in meters (that's often problem that you need to convert the crs for that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried first but I ran into issues trying to get a world CRS in metres that worked and the rivers
layer was acting up so, for the sake of the example, I left it on degrees.
"source": [ | ||
"1. Obtaining a list of European cities\n", | ||
"1. Creating a `GeoDataFrame` with all river lines\n", | ||
"1. For every European city, checking whether at least one river \"crosses\" the area within 1 degree\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this an exercise for notebook 2 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A list of European cities requires a spatial join. It's a compound exercise.
" rivers_crossing = river_lines.crosses(buf).sum()\n", | ||
" if rivers_crossing > 0:\n", | ||
" answer.append(city)\n", | ||
"answer = geopandas.GeoDataFrame(answer, \n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would personally do it with a function and apply
. It is maybe more complex in the end, but a good pattern to show IMO.
Or first with loop, and then as exercise to convert it to apply
I'd merge and use if time allows |
Just so people can access them, can we merge this so the exercises don't get lost on my fork? |
Work in progress but opening for pulling in.