|
60 | 60 | "outputs": [],
|
61 | 61 | "source": [
|
62 | 62 | "import geopandas as gpd\n",
|
| 63 | + "import pandas as pd\n", |
63 | 64 | "import pygmt\n",
|
64 | 65 | "\n",
|
65 | 66 | "# Use a resolution of only 150 dpi for the images within the Jupyter notebook, to keep the file small\n",
|
|
81 | 82 | "source": [
|
82 | 83 | "### 1.1 Tabular data - `pandas.DataFrame`\n",
|
83 | 84 | "\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." |
85 | 87 | ]
|
86 | 88 | },
|
87 | 89 | {
|
|
92 | 94 | "outputs": [],
|
93 | 95 | "source": [
|
94 | 96 | "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\")" |
96 | 100 | ]
|
97 | 101 | },
|
98 | 102 | {
|
|
239 | 243 | "source": [
|
240 | 244 | "#### 2.1.1 Spatial Data - `geopandas.GeoDataFrame` with line geometry\n",
|
241 | 245 | "\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)." |
243 | 252 | ]
|
244 | 253 | },
|
245 | 254 | {
|
|
254 | 263 | " + \"zipped-shapefile-with-wise-large-rivers-vector-line/zipped-shapefile-with-wise-large-rivers-vector-line/\"\n",
|
255 | 264 | " + \"at_download/file/wise_large_rivers.zip\"\n",
|
256 | 265 | ")\n",
|
| 266 | + "# gpd_rivers_org = pd.read_file(\"wise_large_rivers.zip\")\n", |
257 | 267 | "gpd_rivers_org.head()"
|
258 | 268 | ]
|
259 | 269 | },
|
|
542 | 552 | "name": "python",
|
543 | 553 | "nbconvert_exporter": "python",
|
544 | 554 | "pygments_lexer": "ipython3",
|
545 |
| - "version": "3.12.7" |
| 555 | + "version": "3.12.6" |
546 | 556 | }
|
547 | 557 | },
|
548 | 558 | "nbformat": 4,
|
|
0 commit comments