Skip to content

Commit

Permalink
deploy: 9abe29e
Browse files Browse the repository at this point in the history
  • Loading branch information
yvonnefroehlich committed Dec 9, 2024
1 parent 63270bb commit 8c39d0c
Show file tree
Hide file tree
Showing 10 changed files with 6,262 additions and 192 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 14 additions & 4 deletions _sources/tut02_spe_pd_gpd.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"outputs": [],
"source": [
"import geopandas as gpd\n",
"import pandas as pd\n",
"import pygmt\n",
"\n",
"# Use a resolution of only 150 dpi for the images within the Jupyter notebook, to keep the file small\n",
Expand All @@ -81,7 +82,8 @@
"source": [
"### 1.1 Tabular data - `pandas.DataFrame`\n",
"\n",
"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."
"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",
"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."
]
},
{
Expand All @@ -92,7 +94,9 @@
"outputs": [],
"source": [
"df_jp_eqs = pygmt.datasets.load_sample_data(name=\"japan_quakes\")\n",
"df_jp_eqs.head()"
"df_jp_eqs.head()\n",
"\n",
"# df_your_dataset = pd.read_csv(\"your_dataset.csv\")"
]
},
{
Expand Down Expand Up @@ -239,7 +243,12 @@
"source": [
"#### 2.1.1 Spatial Data - `geopandas.GeoDataFrame` with line geometry\n",
"\n",
"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."
"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",
"\n",
"In case you face issues with downloading these data:\n",
"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",
"2. Download the zip file and place it into `~/agu24workshop/book`. Do not unpack the ZIP file.\n",
"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)."
]
},
{
Expand All @@ -254,6 +263,7 @@
" + \"zipped-shapefile-with-wise-large-rivers-vector-line/zipped-shapefile-with-wise-large-rivers-vector-line/\"\n",
" + \"at_download/file/wise_large_rivers.zip\"\n",
")\n",
"# gpd_rivers_org = pd.read_file(\"wise_large_rivers.zip\")\n",
"gpd_rivers_org.head()"
]
},
Expand Down Expand Up @@ -542,7 +552,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.12.6"
}
},
"nbformat": 4,
Expand Down
95 changes: 0 additions & 95 deletions reports/tut03_spe_xarray.err.log

This file was deleted.

2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion tut02_spe_pd_gpd.html
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ <h2>0️⃣ General stuff<a class="headerlink" href="#general-stuff" title="Link
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">geopandas</span> <span class="k">as</span> <span class="nn">gpd</span>
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
<span class="kn">import</span> <span class="nn">pygmt</span>

<span class="c1"># Use a resolution of only 150 dpi for the images within the Jupyter notebook, to keep the file small</span>
Expand All @@ -514,11 +515,14 @@ <h2>0️⃣ General stuff<a class="headerlink" href="#general-stuff" title="Link
<h2>1️⃣ <code class="docutils literal notranslate"><span class="pre">pandas</span></code><a class="headerlink" href="#pandas" title="Link to this heading">#</a></h2>
<section id="tabular-data-pandas-dataframe">
<h3>1.1 Tabular data - <code class="docutils literal notranslate"><span class="pre">pandas.DataFrame</span></code><a class="headerlink" href="#tabular-data-pandas-dataframe" title="Link to this heading">#</a></h3>
<p>Use an example dataset with tabular data provided by <code class="docutils literal notranslate"><span class="pre">PyGMT</span></code> and load it into a <code class="docutils literal notranslate"><span class="pre">pandas.DataFrame</span></code>. This dataset contains earthquakes in the area of Japan.</p>
<p>Use an example dataset with tabular data provided by <code class="docutils literal notranslate"><span class="pre">PyGMT</span></code> and load it into a <code class="docutils literal notranslate"><span class="pre">pandas.DataFrame</span></code>. This dataset contains earthquakes in the area of Japan.
You can read your own dataset into a <code class="docutils literal notranslate"><span class="pre">pandas.Dataframe</span></code> using <a class="reference external" href="https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html"><code class="docutils literal notranslate"><span class="pre">pandas.read_csv</span></code></a> and use it in the same way to make the following plots; of course you have to adjust the column names accordantly.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">df_jp_eqs</span> <span class="o">=</span> <span class="n">pygmt</span><span class="o">.</span><span class="n">datasets</span><span class="o">.</span><span class="n">load_sample_data</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s2">&quot;japan_quakes&quot;</span><span class="p">)</span>
<span class="n">df_jp_eqs</span><span class="o">.</span><span class="n">head</span><span class="p">()</span>

<span class="c1"># df_your_dataset = pd.read_csv(&quot;your_dataset.csv&quot;)</span>
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -708,13 +712,20 @@ <h3>2.1 Line geometry<a class="headerlink" href="#line-geometry" title="Link to
<section id="spatial-data-geopandas-geodataframe-with-line-geometry">
<h4>2.1.1 Spatial Data - <code class="docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code> with line geometry<a class="headerlink" href="#spatial-data-geopandas-geodataframe-with-line-geometry" title="Link to this heading">#</a></h4>
<p>First we download some data into in a <a class="reference external" href="https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.html"><code class="docutils literal notranslate"><span class="pre">geopandas.GeoDataFrame</span></code></a>. This dataset contains European rivers with their lengths and names.</p>
<p>In case you face issues with downloading these data:</p>
<ol class="arabic simple">
<li><p>Copy the URL “<a class="reference external" href="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">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</a>” into your browser.</p></li>
<li><p>Download the zip file and place it into <code class="docutils literal notranslate"><span class="pre">~/agu24workshop/book</span></code>. Do not unpack the ZIP file.</p></li>
<li><p>Replace the URL with the filename of the ZIP file “wise_large_rivers.zip” in <a class="reference external" href="https://geopandas.org/en/stable/docs/reference/api/geopandas.read_file.html"><code class="docutils literal notranslate"><span class="pre">geopandas.read_file</span></code></a>.</p></li>
</ol>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">gpd_rivers_org</span> <span class="o">=</span> <span class="n">gpd</span><span class="o">.</span><span class="n">read_file</span><span class="p">(</span>
<span class="s2">&quot;https://www.eea.europa.eu/data-and-maps/data/wise-large-rivers-and-large-lakes/&quot;</span>
<span class="o">+</span> <span class="s2">&quot;zipped-shapefile-with-wise-large-rivers-vector-line/zipped-shapefile-with-wise-large-rivers-vector-line/&quot;</span>
<span class="o">+</span> <span class="s2">&quot;at_download/file/wise_large_rivers.zip&quot;</span>
<span class="p">)</span>
<span class="c1"># gpd_rivers_org = pd.read_file(&quot;wise_large_rivers.zip&quot;)</span>
<span class="n">gpd_rivers_org</span><span class="o">.</span><span class="n">head</span><span class="p">()</span>
</pre></div>
</div>
Expand Down
Loading

0 comments on commit 8c39d0c

Please sign in to comment.