diff --git a/starter_kit/monica_exercises/basics_04_steps.ipynb b/starter_kit/monica_exercises/basics_04_steps.ipynb index c491493a0..74d4c886d 100644 --- a/starter_kit/monica_exercises/basics_04_steps.ipynb +++ b/starter_kit/monica_exercises/basics_04_steps.ipynb @@ -24,10 +24,27 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 1, "id": "9305f4e1-446d-432f-bc0e-e69284fdce71", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/opt/conda/lib/python3.9/site-packages/geopandas/_compat.py:124: UserWarning: The Shapely GEOS version (3.11.1-CAPI-1.17.1) is incompatible with the GEOS version PyGEOS was compiled with (3.10.1-CAPI-1.16.0). Conversions between both will be slow.\n", + " warnings.warn(\n", + "/tmp/ipykernel_1381/1652705367.py:1: DeprecationWarning: Shapely 2.0 is installed, but because PyGEOS is also installed, GeoPandas still uses PyGEOS by default. However, starting with version 0.14, the default will switch to Shapely. To force to use Shapely 2.0 now, you can either uninstall PyGEOS or set the environment variable USE_PYGEOS=0. You can do this before starting the Python process, or in your code before importing geopandas:\n", + "\n", + "import os\n", + "os.environ['USE_PYGEOS'] = '0'\n", + "import geopandas\n", + "\n", + "In the next release, GeoPandas will switch to using Shapely by default, even if PyGEOS is installed. If you only have PyGEOS installed to get speed-ups, this switch should be smooth. However, if you are using PyGEOS directly (calling PyGEOS functions on geometries from GeoPandas), this will then stop working and you are encouraged to migrate from PyGEOS to Shapely 2.0 (https://shapely.readthedocs.io/en/latest/migration_pygeos.html).\n", + " import geopandas as gpd\n" + ] + } + ], "source": [ "import geopandas as gpd\n", "import pandas as pd\n", @@ -44,7 +61,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 2, "id": "0e4cc814-de2b-4484-a702-b20166587024", "metadata": {}, "outputs": [ @@ -137,7 +154,7 @@ "4 Juniper Ave @ Valley St (eastbound) " ] }, - "execution_count": 7, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -166,11 +183,12 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 3, "id": "a83cda9e-c642-4acf-8668-d5626dd7d948", "metadata": {}, "outputs": [], "source": [ + "#Listing the feed_key for Caltrain and Merced\n", "FEEDS = [\n", " \"25c6505166c01099b2f6f2de173e20b9\", # Caltrain\n", " \"52639f09eb535f75b33d2c6a654cb89e\", # Merced\n", @@ -189,7 +207,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 4, "id": "4fd01576-1163-421b-b7d1-02e6d5c065e2", "metadata": {}, "outputs": [ @@ -262,8 +280,57 @@ "
232 rows × 5 columns
\n", "" ], "text/plain": [ @@ -273,22 +340,150 @@ "58 25c6505166c01099b2f6f2de173e20b9 70031 37.709537 -122.401586 \n", "1 25c6505166c01099b2f6f2de173e20b9 70042 37.655942 -122.404980 \n", "52 25c6505166c01099b2f6f2de173e20b9 70052 37.630461 -122.411709 \n", + ".. ... ... ... ... \n", + "219 52639f09eb535f75b33d2c6a654cb89e 782486 36.981746 -120.627963 \n", + "19 52639f09eb535f75b33d2c6a654cb89e 782487 36.982797 -120.625370 \n", + "85 52639f09eb535f75b33d2c6a654cb89e 782489 36.992336 -120.626187 \n", + "22 52639f09eb535f75b33d2c6a654cb89e 844203 37.391296 -120.722486 \n", + "99 52639f09eb535f75b33d2c6a654cb89e 844204 37.058013 -120.822685 \n", "\n", " stop_name \n", "134 22nd Street \n", "50 22nd Street Caltrain Station \n", "58 Bayshore Caltrain Station \n", "1 South San Francisco Caltrain Station \n", - "52 San Bruno Caltrain Station " + "52 San Bruno Caltrain Station \n", + ".. ... \n", + "219 Golden Gate Ave & Valeria St Stop \n", + "19 Lucerne Ave and Ida St \n", + "85 Obanion Park \n", + "22 Foster Farms (To Livingston) \n", + "99 Food 4 Less / Dollar Tree \n", + "\n", + "[232 rows x 5 columns]" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "stops" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "9e0d2595-f9b8-4c23-831d-0ff6d8feb16d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + " | feed_key | \n", + "stop_id | \n", + "stop_lat | \n", + "stop_lon | \n", + "stop_name | \n", + "geometry | \n", + "
---|---|---|---|---|---|---|
134 | \n", + "25c6505166c01099b2f6f2de173e20b9 | \n", + "22nd_street | \n", + "37.756972 | \n", + "-122.392492 | \n", + "22nd Street | \n", + "POINT (-122.39249 37.75697) | \n", + "
50 | \n", + "25c6505166c01099b2f6f2de173e20b9 | \n", + "70021 | \n", + "37.757599 | \n", + "-122.391880 | \n", + "22nd Street Caltrain Station | \n", + "POINT (-122.39188 37.75760) | \n", + "
58 | \n", + "25c6505166c01099b2f6f2de173e20b9 | \n", + "70031 | \n", + "37.709537 | \n", + "-122.401586 | \n", + "Bayshore Caltrain Station | \n", + "POINT (-122.40159 37.70954) | \n", + "
1 | \n", + "25c6505166c01099b2f6f2de173e20b9 | \n", + "70042 | \n", + "37.655942 | \n", + "-122.404980 | \n", + "South San Francisco Caltrain Station | \n", + "POINT (-122.40498 37.65594) | \n", + "
52 | \n", + "25c6505166c01099b2f6f2de173e20b9 | \n", + "70052 | \n", + "37.630461 | \n", + "-122.411709 | \n", + "San Bruno Caltrain Station | \n", + "POINT (-122.41171 37.63046) | \n", + "
\n", + " | feed_key | \n", + "stop_id | \n", + "stop_lat | \n", + "stop_lon | \n", + "stop_name | \n", + "operator | \n", + "agency | \n", + "
---|---|---|---|---|---|---|---|
134 | \n", + "25c6505166c01099b2f6f2de173e20b9 | \n", + "22nd_street | \n", + "37.756972 | \n", + "-122.392492 | \n", + "22nd Street | \n", + "Caltrain | \n", + "Caltrain | \n", + "
50 | \n", + "25c6505166c01099b2f6f2de173e20b9 | \n", + "70021 | \n", + "37.757599 | \n", + "-122.391880 | \n", + "22nd Street Caltrain Station | \n", + "Caltrain | \n", + "Caltrain | \n", + "
58 | \n", + "25c6505166c01099b2f6f2de173e20b9 | \n", + "70031 | \n", + "37.709537 | \n", + "-122.401586 | \n", + "Bayshore Caltrain Station | \n", + "Caltrain | \n", + "Caltrain | \n", + "
1 | \n", + "25c6505166c01099b2f6f2de173e20b9 | \n", + "70042 | \n", + "37.655942 | \n", + "-122.404980 | \n", + "South San Francisco Caltrain Station | \n", + "Caltrain | \n", + "Caltrain | \n", + "
52 | \n", + "25c6505166c01099b2f6f2de173e20b9 | \n", + "70052 | \n", + "37.630461 | \n", + "-122.411709 | \n", + "San Bruno Caltrain Station | \n", + "Caltrain | \n", + "Caltrain | \n", + "
... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "... | \n", + "
219 | \n", + "52639f09eb535f75b33d2c6a654cb89e | \n", + "782486 | \n", + "36.981746 | \n", + "-120.627963 | \n", + "Golden Gate Ave & Valeria St Stop | \n", + "Merced | \n", + "Merced | \n", + "
19 | \n", + "52639f09eb535f75b33d2c6a654cb89e | \n", + "782487 | \n", + "36.982797 | \n", + "-120.625370 | \n", + "Lucerne Ave and Ida St | \n", + "Merced | \n", + "Merced | \n", + "
85 | \n", + "52639f09eb535f75b33d2c6a654cb89e | \n", + "782489 | \n", + "36.992336 | \n", + "-120.626187 | \n", + "Obanion Park | \n", + "Merced | \n", + "Merced | \n", + "
22 | \n", + "52639f09eb535f75b33d2c6a654cb89e | \n", + "844203 | \n", + "37.391296 | \n", + "-120.722486 | \n", + "Foster Farms (To Livingston) | \n", + "Merced | \n", + "Merced | \n", + "
99 | \n", + "52639f09eb535f75b33d2c6a654cb89e | \n", + "844204 | \n", + "37.058013 | \n", + "-120.822685 | \n", + "Food 4 Less / Dollar Tree | \n", + "Merced | \n", + "Merced | \n", + "
232 rows × 7 columns
\n", + "