Skip to content

Commit 9abe29e

Browse files
Tutorial 02: Notes reading usage of own tabular data, dowload issue of river data (#35)
1 parent be100a9 commit 9abe29e

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

book/tut02_spe_pd_gpd.ipynb

+14-4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"outputs": [],
6161
"source": [
6262
"import geopandas as gpd\n",
63+
"import pandas as pd\n",
6364
"import pygmt\n",
6465
"\n",
6566
"# Use a resolution of only 150 dpi for the images within the Jupyter notebook, to keep the file small\n",
@@ -81,7 +82,8 @@
8182
"source": [
8283
"### 1.1 Tabular data - `pandas.DataFrame`\n",
8384
"\n",
84-
"Use an example dataset with tabular data provided by `PyGMT` and load it into a `pandas.DataFrame`. This dataset contains earthquakes in the area of Japan."
85+
"Use an example dataset with tabular data provided by `PyGMT` and load it into a `pandas.DataFrame`. This dataset contains earthquakes in the area of Japan.\n",
86+
"You can read your own dataset into a `pandas.Dataframe` using [`pandas.read_csv`](https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html) and use it in the same way to make the following plots; of course you have to adjust the column names accordantly."
8587
]
8688
},
8789
{
@@ -92,7 +94,9 @@
9294
"outputs": [],
9395
"source": [
9496
"df_jp_eqs = pygmt.datasets.load_sample_data(name=\"japan_quakes\")\n",
95-
"df_jp_eqs.head()"
97+
"df_jp_eqs.head()\n",
98+
"\n",
99+
"# df_your_dataset = pd.read_csv(\"your_dataset.csv\")"
96100
]
97101
},
98102
{
@@ -239,7 +243,12 @@
239243
"source": [
240244
"#### 2.1.1 Spatial Data - `geopandas.GeoDataFrame` with line geometry\n",
241245
"\n",
242-
"First we download some data into in a [`geopandas.GeoDataFrame`](https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.html). This dataset contains European rivers with their lengths and names."
246+
"First we download some data into in a [`geopandas.GeoDataFrame`](https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.html). This dataset contains European rivers with their lengths and names.\n",
247+
"\n",
248+
"In case you face issues with downloading these data:\n",
249+
"1. Copy the URL \"https://www.eea.europa.eu/data-and-maps/data/wise-large-rivers-and-large-lakes/zipped-shapefile-with-wise-large-rivers-vector-line/zipped-shapefile-with-wise-large-rivers-vector-line/at_download/file/wise_large_rivers.zip\" into your browser.\n",
250+
"2. Download the zip file and place it into `~/agu24workshop/book`. Do not unpack the ZIP file.\n",
251+
"3. Replace the URL with the filename of the ZIP file \"wise_large_rivers.zip\" in [`geopandas.read_file`](https://geopandas.org/en/stable/docs/reference/api/geopandas.read_file.html)."
243252
]
244253
},
245254
{
@@ -254,6 +263,7 @@
254263
" + \"zipped-shapefile-with-wise-large-rivers-vector-line/zipped-shapefile-with-wise-large-rivers-vector-line/\"\n",
255264
" + \"at_download/file/wise_large_rivers.zip\"\n",
256265
")\n",
266+
"# gpd_rivers_org = pd.read_file(\"wise_large_rivers.zip\")\n",
257267
"gpd_rivers_org.head()"
258268
]
259269
},
@@ -542,7 +552,7 @@
542552
"name": "python",
543553
"nbconvert_exporter": "python",
544554
"pygments_lexer": "ipython3",
545-
"version": "3.12.7"
555+
"version": "3.12.6"
546556
}
547557
},
548558
"nbformat": 4,

0 commit comments

Comments
 (0)