Skip to content

Commit

Permalink
fix windows _getting_started
Browse files Browse the repository at this point in the history
  • Loading branch information
fabridamicelli committed Oct 20, 2024
1 parent df74cef commit 61b4f19
Show file tree
Hide file tree
Showing 11 changed files with 291 additions and 392 deletions.
5 changes: 3 additions & 2 deletions chapters/01_getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@
"```\n",
"\n",
"**Windows**\n",
"Make sure you are using **powershell**!\n",
"\n",
"```bash\n",
"powershell -ExecutionPolicy ByPass -c \"irm https://astral.sh/uv/install.ps1 | iex\"\n",
"```\n",
"Warning: Maybe you need to have administrator permission to get this working. \n",
"Try that out if the plain run does not work.\n",
"\n",
"\n",
"That should be enough, but for more details you can follow detailed instructions [here](https://docs.astral.sh/uv/getting-started/installation/)."
]
Expand Down
139 changes: 0 additions & 139 deletions chapters/081_pandas.ipynb

Large diffs are not rendered by default.

156 changes: 156 additions & 0 deletions chapters/09_plotting.ipynb

Large diffs are not rendered by default.

158 changes: 37 additions & 121 deletions chapters/lab_explore_data_solutions.ipynb

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions docs/01_getting_started.html
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,8 @@ <h2 data-number="1.2" class="anchored" data-anchor-id="install-uv"><span class="
<p>Run only one of these commands in your terminal - pick according to your operating system:</p>
<p><strong>Linux and macOS</strong></p>
<div class="sourceCode" id="cb1"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="ex">curl</span> <span class="at">-LsSf</span> https://astral.sh/uv/install.sh <span class="kw">|</span> <span class="fu">sh</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p><strong>Windows</strong></p>
<p><strong>Windows</strong> Make sure you are using <strong>powershell</strong>!</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">powershell</span> <span class="at">-ExecutionPolicy</span> ByPass <span class="at">-c</span> <span class="st">"irm https://astral.sh/uv/install.ps1 | iex"</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>Warning: Maybe you need to have administrator permission to get this working. Try that out if the plain run does not work.</p>
<p>That should be enough, but for more details you can follow detailed instructions <a href="https://docs.astral.sh/uv/getting-started/installation/">here</a>.</p>
</section>
<section id="working-on-a-project" class="level2" data-number="1.3">
Expand Down
119 changes: 1 addition & 118 deletions docs/081_pandas.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,10 @@
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
</style>


<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script><script src="site_libs/quarto-nav/quarto-nav.js"></script>
<script src="site_libs/quarto-nav/quarto-nav.js"></script>
<script src="site_libs/quarto-nav/headroom.min.js"></script>
<script src="site_libs/clipboard/clipboard.min.js"></script>
<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
Expand Down Expand Up @@ -104,9 +70,6 @@
}</script>
<!-- plausible -->
<script defer="" data-domain="fabridamicelli.github.io/python-course" src="https://plausible.io/js/script.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" integrity="sha512-c3Nl8+7g4LMSTdrm621y7kf9v3SDPnhxLNhcjFJbKECVnmZHTdo+IRO05sNLTH/D3vA6u1X32ehoLC7WFVdheg==" crossorigin="anonymous"></script>

<script type="application/javascript">define('jquery', [],function() {return window.jQuery;})</script>


</head>
Expand Down Expand Up @@ -393,86 +356,6 @@ <h1 class="title"><span class="chapter-number">15</span>&nbsp; <span class="chap
<p>Check out the pandas getting-started documentation <a href="https://pandas.pydata.org/docs/getting_started/index.html#getting-started">here</a></p>
<p>Here’s short introduction by the very author of the library:</p>
<div class="quarto-video ratio ratio-16x9"><iframe data-external="1" src="https://www.youtube.com/embed/_T8LGqJtuGc" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></div>
<div id="7617b9b8-455a-44f0-9856-8b2e248d11a0" class="cell" data-execution_count="1">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> seaborn <span class="im">as</span> sns</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div id="91cfdd53-1b65-4b02-b0f8-5bd227b6da4e" class="cell" data-execution_count="2">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>df <span class="op">=</span> sns.load_dataset(<span class="st">"fmri"</span>)</span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a>df.head()</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="2">
<div>
<div>


<table class="dataframe table table-sm table-striped small" data-quarto-postprocess="true" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">subject</th>
<th data-quarto-table-cell-role="th">timepoint</th>
<th data-quarto-table-cell-role="th">event</th>
<th data-quarto-table-cell-role="th">region</th>
<th data-quarto-table-cell-role="th">signal</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td data-quarto-table-cell-role="th">0</td>
<td>s13</td>
<td>18</td>
<td>stim</td>
<td>parietal</td>
<td>-0.017552</td>
</tr>
<tr class="even">
<td data-quarto-table-cell-role="th">1</td>
<td>s5</td>
<td>14</td>
<td>stim</td>
<td>parietal</td>
<td>-0.080883</td>
</tr>
<tr class="odd">
<td data-quarto-table-cell-role="th">2</td>
<td>s12</td>
<td>18</td>
<td>stim</td>
<td>parietal</td>
<td>-0.081033</td>
</tr>
<tr class="even">
<td data-quarto-table-cell-role="th">3</td>
<td>s11</td>
<td>18</td>
<td>stim</td>
<td>parietal</td>
<td>-0.046134</td>
</tr>
<tr class="odd">
<td data-quarto-table-cell-role="th">4</td>
<td>s10</td>
<td>18</td>
<td>stim</td>
<td>parietal</td>
<td>-0.037970</td>
</tr>
</tbody>
</table>

</div>
</div>
</div>
</div>
<div id="97350317-64f0-48cf-b73d-b14e2364ce87" class="cell" data-execution_count="35">
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>sns.lineplot(df, x<span class="op">=</span><span class="st">"timepoint"</span>, y<span class="op">=</span><span class="st">"signal"</span>, marker<span class="op">=</span><span class="st">"."</span>, hue<span class="op">=</span><span class="st">"region"</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">
<div>
<figure class="figure">
<p><img src="081_pandas_files/figure-html/cell-4-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
<section id="exercises" class="level2" data-number="15.1">
<h2 data-number="15.1" class="anchored" data-anchor-id="exercises"><span class="header-section-number">15.1</span> Exercises</h2>
<ul>
Expand Down
91 changes: 87 additions & 4 deletions docs/09_plotting.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</style>


<script src="site_libs/quarto-nav/quarto-nav.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script><script src="site_libs/quarto-nav/quarto-nav.js"></script>
<script src="site_libs/quarto-nav/headroom.min.js"></script>
<script src="site_libs/clipboard/clipboard.min.js"></script>
<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
Expand Down Expand Up @@ -104,6 +104,9 @@
}</script>
<!-- plausible -->
<script defer="" data-domain="fabridamicelli.github.io/python-course" src="https://plausible.io/js/script.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" integrity="sha512-c3Nl8+7g4LMSTdrm621y7kf9v3SDPnhxLNhcjFJbKECVnmZHTdo+IRO05sNLTH/D3vA6u1X32ehoLC7WFVdheg==" crossorigin="anonymous"></script>

<script type="application/javascript">define('jquery', [],function() {return window.jQuery;})</script>


</head>
Expand Down Expand Up @@ -597,12 +600,92 @@ <h2 data-number="16.2" class="anchored" data-anchor-id="seaborn"><span class="he
<div id="e1873ded-3509-41f8-9426-2f91ac2bc468" class="cell" data-execution_count="14">
<div class="sourceCode cell-code" id="cb18"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a>sns.set_theme(style<span class="op">=</span><span class="st">"dark"</span>, font_scale<span class="op">=</span><span class="fl">1.4</span>) <span class="co"># this has global effects</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div id="c35acd2a-ca30-4bbd-8a01-79cbc19b8e02" class="cell" data-execution_count="1">
<div class="sourceCode cell-code" id="cb19"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> seaborn <span class="im">as</span> sns</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div id="7f36da8e-2f9e-45ae-ae58-471f2e2f1572" class="cell" data-execution_count="2">
<div class="sourceCode cell-code" id="cb20"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a>df <span class="op">=</span> sns.load_dataset(<span class="st">"fmri"</span>)</span>
<span id="cb20-2"><a href="#cb20-2" aria-hidden="true" tabindex="-1"></a>df.head()</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="2">
<div>
<div>


<table class="dataframe table table-sm table-striped small" data-quarto-postprocess="true" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">subject</th>
<th data-quarto-table-cell-role="th">timepoint</th>
<th data-quarto-table-cell-role="th">event</th>
<th data-quarto-table-cell-role="th">region</th>
<th data-quarto-table-cell-role="th">signal</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td data-quarto-table-cell-role="th">0</td>
<td>s13</td>
<td>18</td>
<td>stim</td>
<td>parietal</td>
<td>-0.017552</td>
</tr>
<tr class="even">
<td data-quarto-table-cell-role="th">1</td>
<td>s5</td>
<td>14</td>
<td>stim</td>
<td>parietal</td>
<td>-0.080883</td>
</tr>
<tr class="odd">
<td data-quarto-table-cell-role="th">2</td>
<td>s12</td>
<td>18</td>
<td>stim</td>
<td>parietal</td>
<td>-0.081033</td>
</tr>
<tr class="even">
<td data-quarto-table-cell-role="th">3</td>
<td>s11</td>
<td>18</td>
<td>stim</td>
<td>parietal</td>
<td>-0.046134</td>
</tr>
<tr class="odd">
<td data-quarto-table-cell-role="th">4</td>
<td>s10</td>
<td>18</td>
<td>stim</td>
<td>parietal</td>
<td>-0.037970</td>
</tr>
</tbody>
</table>

</div>
</div>
</div>
</div>
<div id="135ed828-dd1e-48ad-b77e-70b801ab3400" class="cell" data-execution_count="35">
<div class="sourceCode cell-code" id="cb21"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a>sns.lineplot(df, x<span class="op">=</span><span class="st">"timepoint"</span>, y<span class="op">=</span><span class="st">"signal"</span>, marker<span class="op">=</span><span class="st">"."</span>, hue<span class="op">=</span><span class="st">"region"</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">
<div>
<figure class="figure">
<p><img src="09_plotting_files/figure-html/cell-18-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
<div id="8926774e-e0bc-4f87-974b-d3059636adb6" class="cell" data-execution_count="15">
<div class="sourceCode cell-code" id="cb19"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a>plot_images(data)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="sourceCode cell-code" id="cb22"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a>plot_images(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">
<div>
<figure class="figure">
<p><img src="09_plotting_files/figure-html/cell-16-output-1.png" class="img-fluid figure-img"></p>
<p><img src="09_plotting_files/figure-html/cell-21-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
Expand Down Expand Up @@ -669,7 +752,7 @@ <h2 data-number="16.2" class="anchored" data-anchor-id="seaborn"><span class="he
<section id="exercises" class="level2" data-number="16.3">
<h2 data-number="16.3" class="anchored" data-anchor-id="exercises"><span class="header-section-number">16.3</span> Exercises</h2>
<ol type="1">
<li><p>Use numpy to create 4 arrays of numbers drawn from 4 different distributions: uniform, normal, lognormal and exponential. Each array should have of 100000 samples. Use matplotlib to plot a grid of 2x2 subplots, with one histogram on each subplot. Hint: Look at numpy’s submodule <code>random</code>.</p></li>
<li><p>Use numpy to create 4 arrays of numbers drawn from 4 different distributions: uniform, normal, lognormal and exponential. Each array should have of 100000 samples. Use matplotlib to plot a grid of 2x2 subplots, with one histogram on each subplot. Each histogram should have a different color. Hint: Look at numpy’s submodule <code>random</code>.</p></li>
<li><p>Pick one interesting example of the <a href="http://seaborn.pydata.org/examples/index.html">Seaborn gallery</a> and reproduce it on your computer. Change 1 or 2 parameters of the plot, for example, some color or order of variables, remove/add a variable. If you have own data with a similar shape, plot those!</p></li>
</ol>

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 61b4f19

Please sign in to comment.