Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Quarto GHA Workflow Runner committed Sep 28, 2023
1 parent 93831cf commit 0f56623
Show file tree
Hide file tree
Showing 19 changed files with 98 additions and 304 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7ebd3f30
6fadf16e
2 changes: 1 addition & 1 deletion Introduction_to_python_2.html
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ <h2 data-number="3.3" class="anchored" data-anchor-id="boolean-values-logical-ex
</div>
<div class="alert alert-block alert-success">
<p><b>Exercises</b></p>
<p>Now go back to your browser to morning_exercises.ipynb and continue with exercises 0-3.</p>
<p>Now open the <code>morning_exercises.ipynb</code> notebook from the place where you have stored it (<a href="./installation-and-setup.html">see Installation and setup instruction</a>) and do exercises 0-3.</p>
<p>When you finished the exercises, continue to chapter <a href="./Introduction_to_python_3.html">Data types, if-statements and for loops</a></p>
</div>

Expand Down
2 changes: 1 addition & 1 deletion Introduction_to_python_4.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ <h2 data-number="5.1" class="anchored" data-anchor-id="functions"><span class="h
<pre><code>18</code></pre>
</div>
</div>
<p>Please refer to https://docs.python.org/3/library/functions.html for more built-in functions.</p>
<p>The <a href="https://docs.python.org/3/library/functions.html">Python Documentation at <strong>docs.python.org</strong></a> has more info about built-in functions.</p>
<section id="writing-own-functions" class="level3" data-number="5.1.1">
<h3 data-number="5.1.1" class="anchored" data-anchor-id="writing-own-functions"><span class="header-section-number">5.1.1</span> Writing own functions</h3>
<p>We will now turn to writing own functions. When should you write your own function?</p>
Expand Down
3 changes: 0 additions & 3 deletions course-materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,6 @@ <h2 class="anchored" data-anchor-id="zipped-file">Zipped File</h2>
│ ├── species.csv
│ ├── surveys.csv
│ └── plots.csv
├── solutions
│ ├── morning_exercises_solutions.ipynb
│ └── afternoon_exercises_solutions.ipynb
├── morning_exercises.ipynb
└── afternoon_exercises.ipynb </code></pre>
</section>
Expand Down
275 changes: 39 additions & 236 deletions data-science-with-pandas-1.html

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion data-science-with-pandas-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,7 @@ <h2 data-number="7.5" class="anchored" data-anchor-id="grouping"><span class="he
<div class="cell" data-execution_count="31">
<div class="sourceCode cell-code" id="cb46"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb46-1"><a href="#cb46-1" aria-hidden="true" tabindex="-1"></a>grouped_data.mean()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stderr">
<pre><code>/tmp/ipykernel_2422/1133710423.py:1: FutureWarning: The default value of numeric_only in DataFrameGroupBy.mean is deprecated. In a future version, numeric_only will default to False. Either specify numeric_only or select only columns which should be valid for the function.
<pre><code>/tmp/ipykernel_2397/1133710423.py:1: FutureWarning: The default value of numeric_only in DataFrameGroupBy.mean is deprecated. In a future version, numeric_only will default to False. Either specify numeric_only or select only columns which should be valid for the function.
grouped_data.mean()</code></pre>
</div>
<div class="cell-output cell-output-display" data-execution_count="31">
Expand Down
2 changes: 1 addition & 1 deletion data-science-with-pandas-3.html
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ <h2 data-number="8.2" class="anchored" data-anchor-id="joining-dataframes"><span
<li>Do you want to get <strong>all the information</strong> from the two DataFrames? Then you use an <strong>outer join</strong>.</li>
</ul>
<div class="alert alert-block alert-success">
<p><b>Exercise 12</b></p>
<p><b>Exercises 10 and 11</b></p>
<p>Now go to the Jupyter Dashboard in your internet browser and continue with exercise 10 and 11.</p>
<p>We will continue with <a href="./data-science-with-pandas-4.html">Data visualization</a>.</p>

Expand Down
84 changes: 40 additions & 44 deletions data-science-with-pandas-4.html
Original file line number Diff line number Diff line change
Expand Up @@ -366,37 +366,35 @@ <h2 data-number="9.3" class="anchored" data-anchor-id="histograms"><span class="
<div class="cell" data-execution_count="4">
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>plt.hist(sample_data)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="4">
<pre><code>(array([ 16., 123., 590., 1688., 2834., 2697., 1487., 446., 109.,
10.]),
array([-0.37774022, -0.30084311, -0.223946 , -0.14704889, -0.07015178,
0.00674533, 0.08364244, 0.16053955, 0.23743666, 0.31433377,
0.39123088]),
<pre><code>(array([ 19., 158., 722., 1780., 2750., 2610., 1378., 472., 99.,
12.]),
array([-0.35740211, -0.28378817, -0.21017423, -0.13656028, -0.06294634,
0.0106676 , 0.08428154, 0.15789549, 0.23150943, 0.30512337,
0.37873732]),
&lt;BarContainer object of 10 artists&gt;)</code></pre>
</div>
<div class="cell-output cell-output-display">
<p><img src="data-science-with-pandas-4_files/figure-html/cell-5-output-2.png" width="583" height="411"></p>
<p><img src="data-science-with-pandas-4_files/figure-html/cell-5-output-2.png" width="584" height="411"></p>
</div>
</div>
<p>As we expected, the histogram is centered around 0 and we can already see the bell shape arising among the blocks. The default values of histogram bins (blocks) is 10, so in our case 10000 points are subdivided into 10 bins, but we can change that by specifying the parameter <code>bins</code>:</p>
<div class="cell" data-execution_count="5">
<div class="sourceCode cell-code" id="cb6"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>plt.hist(sample_data, bins<span class="op">=</span><span class="dv">30</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="5">
<pre><code>(array([3.000e+00, 4.000e+00, 9.000e+00, 1.900e+01, 3.600e+01, 6.800e+01,
1.180e+02, 1.830e+02, 2.890e+02, 3.680e+02, 5.580e+02, 7.620e+02,
8.690e+02, 1.003e+03, 9.620e+02, 1.014e+03, 9.110e+02, 7.720e+02,
6.340e+02, 4.910e+02, 3.620e+02, 2.270e+02, 1.360e+02, 8.300e+01,
5.700e+01, 3.200e+01, 2.000e+01, 6.000e+00, 3.000e+00, 1.000e+00]),
array([-0.37774022, -0.35210785, -0.32647548, -0.30084311, -0.27521074,
-0.24957837, -0.223946 , -0.19831363, -0.17268126, -0.14704889,
-0.12141652, -0.09578415, -0.07015178, -0.04451941, -0.01888704,
0.00674533, 0.0323777 , 0.05801007, 0.08364244, 0.10927481,
0.13490718, 0.16053955, 0.18617192, 0.21180429, 0.23743666,
0.26306903, 0.2887014 , 0.31433377, 0.33996614, 0.36559851,
0.39123088]),
<pre><code>(array([ 2., 9., 8., 30., 46., 82., 156., 232., 334., 460., 593.,
727., 846., 910., 994., 921., 897., 792., 622., 449., 307., 226.,
161., 85., 54., 33., 12., 9., 0., 3.]),
array([-0.35740211, -0.33286413, -0.30832615, -0.28378817, -0.25925019,
-0.23471221, -0.21017423, -0.18563625, -0.16109826, -0.13656028,
-0.1120223 , -0.08748432, -0.06294634, -0.03840836, -0.01387038,
0.0106676 , 0.03520558, 0.05974356, 0.08428154, 0.10881953,
0.13335751, 0.15789549, 0.18243347, 0.20697145, 0.23150943,
0.25604741, 0.28058539, 0.30512337, 0.32966135, 0.35419934,
0.37873732]),
&lt;BarContainer object of 30 artists&gt;)</code></pre>
</div>
<div class="cell-output cell-output-display">
<p><img src="data-science-with-pandas-4_files/figure-html/cell-6-output-2.png" width="583" height="411"></p>
<p><img src="data-science-with-pandas-4_files/figure-html/cell-6-output-2.png" width="584" height="411"></p>
</div>
</div>
<p>You may have noticed that increasing the number of bins, the bell shape of the histogram is even more evident.</p>
Expand Down Expand Up @@ -438,7 +436,7 @@ <h2 data-number="9.5" class="anchored" data-anchor-id="customizing-titles-and-la
<pre><code>Text(0.5, 0.98, 'Histogram')</code></pre>
</div>
<div class="cell-output cell-output-display">
<p><img src="data-science-with-pandas-4_files/figure-html/cell-7-output-2.png" width="601" height="477"></p>
<p><img src="data-science-with-pandas-4_files/figure-html/cell-7-output-2.png" width="602" height="477"></p>
</div>
</div>
<p>Note: To plot data on our Axes we used the same plotting methods used in the previous examples. We used <code>hist()</code> sampling the data in 30 bins, but this time we had to call the function from the Axes object, so <code>ax.hist()</code>.</p>
Expand Down Expand Up @@ -477,22 +475,20 @@ <h2 data-number="9.6" class="anchored" data-anchor-id="creating-subplots"><span
<div class="sourceCode cell-code" id="cb13"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a>fig, ax <span class="op">=</span> plt.subplots() <span class="co"># initiate an empty figure and axis matplotlib object</span></span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a>ax.hist(sample_data, bins<span class="op">=</span> <span class="dv">30</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="8">
<pre><code>(array([3.000e+00, 4.000e+00, 9.000e+00, 1.900e+01, 3.600e+01, 6.800e+01,
1.180e+02, 1.830e+02, 2.890e+02, 3.680e+02, 5.580e+02, 7.620e+02,
8.690e+02, 1.003e+03, 9.620e+02, 1.014e+03, 9.110e+02, 7.720e+02,
6.340e+02, 4.910e+02, 3.620e+02, 2.270e+02, 1.360e+02, 8.300e+01,
5.700e+01, 3.200e+01, 2.000e+01, 6.000e+00, 3.000e+00, 1.000e+00]),
array([-0.37774022, -0.35210785, -0.32647548, -0.30084311, -0.27521074,
-0.24957837, -0.223946 , -0.19831363, -0.17268126, -0.14704889,
-0.12141652, -0.09578415, -0.07015178, -0.04451941, -0.01888704,
0.00674533, 0.0323777 , 0.05801007, 0.08364244, 0.10927481,
0.13490718, 0.16053955, 0.18617192, 0.21180429, 0.23743666,
0.26306903, 0.2887014 , 0.31433377, 0.33996614, 0.36559851,
0.39123088]),
<pre><code>(array([ 2., 9., 8., 30., 46., 82., 156., 232., 334., 460., 593.,
727., 846., 910., 994., 921., 897., 792., 622., 449., 307., 226.,
161., 85., 54., 33., 12., 9., 0., 3.]),
array([-0.35740211, -0.33286413, -0.30832615, -0.28378817, -0.25925019,
-0.23471221, -0.21017423, -0.18563625, -0.16109826, -0.13656028,
-0.1120223 , -0.08748432, -0.06294634, -0.03840836, -0.01387038,
0.0106676 , 0.03520558, 0.05974356, 0.08428154, 0.10881953,
0.13335751, 0.15789549, 0.18243347, 0.20697145, 0.23150943,
0.25604741, 0.28058539, 0.30512337, 0.32966135, 0.35419934,
0.37873732]),
&lt;BarContainer object of 30 artists&gt;)</code></pre>
</div>
<div class="cell-output cell-output-display">
<p><img src="data-science-with-pandas-4_files/figure-html/cell-9-output-2.png" width="583" height="411"></p>
<p><img src="data-science-with-pandas-4_files/figure-html/cell-9-output-2.png" width="584" height="411"></p>
</div>
</div>
<p>Once we defined a Figure and an Axes, we can add other Axes to our Figure using <code>fig.add_axes([left,bottom,length,height])</code> where the argument is a list containing the coordinates of our new Axes in the following format: [left edge, bottom edge, length, and height]. The left edge and bottom edgeare scaled from 0 to 1, so that 0.5 corresponds to the center of the Figure. For example, the list of coordinates [0.5,0.5,0.33,0.33] will locate the bottom-left corner of our additional Axis at the very center of the Figure. The new plot will be as wide as ~1/3 of the length of the Figure and as high as ~1/3 of the height of the Figure.</p>
Expand All @@ -515,20 +511,20 @@ <h2 data-number="9.6" class="anchored" data-anchor-id="creating-subplots"><span
<span id="cb15-16"><a href="#cb15-16" aria-hidden="true" tabindex="-1"></a><span class="co">#ax2 = fig.add_axes([left, bottom, right, top])</span></span>
<span id="cb15-17"><a href="#cb15-17" aria-hidden="true" tabindex="-1"></a>ax2.hist(beta_draws, bins<span class="op">=</span><span class="dv">30</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="9">
<pre><code>(array([ 2., 1., 4., 12., 13., 31., 54., 57., 60., 68., 64., 79., 79.,
79., 79., 40., 59., 44., 34., 39., 32., 19., 14., 11., 10., 6.,
4., 3., 2., 1.]),
array([0.03314355, 0.0558779 , 0.07861226, 0.10134661, 0.12408096,
0.14681531, 0.16954966, 0.19228402, 0.21501837, 0.23775272,
0.26048707, 0.28322143, 0.30595578, 0.32869013, 0.35142448,
0.37415883, 0.39689319, 0.41962754, 0.44236189, 0.46509624,
0.4878306 , 0.51056495, 0.5332993 , 0.55603365, 0.578768 ,
0.60150236, 0.62423671, 0.64697106, 0.66970541, 0.69243977,
0.71517412]),
<pre><code>(array([ 6., 5., 12., 13., 27., 34., 43., 60., 72., 73., 74., 87., 65.,
56., 60., 51., 54., 36., 29., 30., 31., 27., 19., 14., 11., 1.,
2., 5., 1., 2.]),
array([0.05640321, 0.07799341, 0.09958361, 0.1211738 , 0.142764 ,
0.1643542 , 0.1859444 , 0.2075346 , 0.22912479, 0.25071499,
0.27230519, 0.29389539, 0.31548559, 0.33707578, 0.35866598,
0.38025618, 0.40184638, 0.42343658, 0.44502677, 0.46661697,
0.48820717, 0.50979737, 0.53138757, 0.55297776, 0.57456796,
0.59615816, 0.61774836, 0.63933856, 0.66092875, 0.68251895,
0.70410915]),
&lt;BarContainer object of 30 artists&gt;)</code></pre>
</div>
<div class="cell-output cell-output-display">
<p><img src="data-science-with-pandas-4_files/figure-html/cell-10-output-2.png" width="601" height="429"></p>
<p><img src="data-science-with-pandas-4_files/figure-html/cell-10-output-2.png" width="602" height="429"></p>
</div>
</div>
<p><code>plt.subplots()</code> parameters allow you to specify all sort of plot features: the size of the Figure in inches or cm, the number of plots to display in the Figure arranged in rows and columns, whether the subplots need to share the same axis, etc. The <a href="https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.subplots.html">Matplotlib documentation</a> provides all the information and examples.</p>
Expand Down
Binary file modified data-science-with-pandas-4_files/figure-html/cell-10-output-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data-science-with-pandas-4_files/figure-html/cell-5-output-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data-science-with-pandas-4_files/figure-html/cell-6-output-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data-science-with-pandas-4_files/figure-html/cell-7-output-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data-science-with-pandas-4_files/figure-html/cell-8-output-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data-science-with-pandas-4_files/figure-html/cell-9-output-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions installation-and-setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,6 @@ <h2 class="anchored" data-anchor-id="obtain-lesson-materials">Obtain lesson mate
<p>In your <code>python-workshop</code> you will see a folders called <code>data</code> and the following files:</p>
<pre><code>python-workshop
├── data
│ ├── EU_capitals_tiny.csv
│ ├── Netherlands_town_weather_tiny.csv
│ ├── species.csv
│ ├── surveys.csv
│ └── plots.csv
Expand Down
4 changes: 2 additions & 2 deletions introduction.html
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ <h2 data-number="1.1" class="anchored" data-anchor-id="what-is-python"><span cla
<p>Python is a general-purpose programming language that is very popular in the scientific community. At Utrecht University it is the most popular programming language for open source research projects @ UU (see <a href="https://github.com/UtrechtUniversity/SWORDS-UU/blob/main/collect_variables/analyze_metrics.ipynb">SWORDS-UU</a>).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="images/programming_languages.png" class="img-fluid figure-img"></p>
<p><img src="images/programming_languages.png" class="img-fluid figure-img" width="400"></p>
<figcaption class="figure-caption">Programming languages by user</figcaption>
</figure>
</div>
Expand All @@ -308,7 +308,7 @@ <h2 data-number="1.1" class="anchored" data-anchor-id="what-is-python"><span cla
</section>
<section id="scope-of-this-course" class="level2" data-number="1.2">
<h2 data-number="1.2" class="anchored" data-anchor-id="scope-of-this-course"><span class="header-section-number">1.2</span> Scope of this course</h2>
<p>Learning to program is a skill that takes time and practice. This course will not make you an expert programmer, but it will give you a small foundation to build on. The course will focus on the basics of the Python language, and simple data handling and visualization with the Pandas Python library. This will be enough to demonstrate the power of Python and hopefully inspire you to learn more. After the course you will have some basic knowledge to get started and we will be available during the <a href="https://www.uu.nl/en/research/research-data-management/workshops/walk-in-hours-research-data-and-software">RDM walk in hours</a> and the <a href="https://www.uu.nl/en/research/research-data-management/workshops/programming-cafe">Programming cafe</a> to help you continue your learning journey and start using Python in your own research.</p>
<p>Programming is a skill that takes time and practice to learn. This course will not make you an expert programmer, but it will give you a small foundation to build on. The course will focus on the basics of the Python language, and simple data handling and visualization with the Pandas Python library. This will be enough to demonstrate the power of Python and hopefully inspire you to learn more. After the course you will have some basic knowledge to get started and we will be available during the <a href="https://www.uu.nl/en/research/research-data-management/workshops/walk-in-hours-research-data-and-software">RDM walk in hours</a> and the <a href="https://www.uu.nl/en/research/research-data-management/workshops/programming-cafe">Programming cafe</a> to help you continue your learning journey and start using Python in your own research.</p>
</section>
<section id="jupyter-notebooks" class="level2" data-number="1.3">
<h2 data-number="1.3" class="anchored" data-anchor-id="jupyter-notebooks"><span class="header-section-number">1.3</span> Jupyter Notebooks</h2>
Expand Down
Loading

0 comments on commit 0f56623

Please sign in to comment.