Skip to content

Commit

Permalink
fixed links
Browse files Browse the repository at this point in the history
  • Loading branch information
kcaylor committed Sep 6, 2024
1 parent c963ae4 commit b144815
Show file tree
Hide file tree
Showing 109 changed files with 1,009 additions and 612 deletions.
2 changes: 2 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ website:
href: course-materials/interactive-sessions/4a_dataframes.qmd
# - text: Session 4d - 🐼 Data Import and Export
# href: course-materials/interactive-sessions/4d_data_import_export.qmd
- text: Session 4c - 🐼 DataFrame Workflows
href: course-materials/interactive-sessions/4c_dataframe_workflows.qmd
- text: Session 4d - 🐼 Data Import and Export
href: course-materials/live-coding/4d_data_import_export.qmd
- text: Session 5a - 🐼 Selecing and Filtering Data
Expand Down
2 changes: 1 addition & 1 deletion course-materials/day4.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ description: "Friday September 6^th^, 2024"
| {{< fa calendar-day title="A calendar with one day highlighted" >}} Session | {{< fa laptop-code title="A laptop with on-screen code" >}} Session 1 | {{< fa laptop-code title="A laptop with on-screen code" >}} Session 2 |
|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| day 4 / morning | [🐼 Intro to DataFrames](interactive-sessions/4a_dataframes.qmd){target="_blank"} | [🙌 Coding Colab: Working with DataFrames](coding-colabs/4b_pandas_dataframes.qmd){target="_blank"} |
| day 4 / afternoon | [🐼 DataFrame Workflows](interactive-session/4c_dataframe_workflows.qmd) | [📝 Data Import/Export](live-coding/4d_data_import_export.qmd) |
| day 4 / afternoon | [🐼 DataFrame Workflows](interactive-sessions/4c_dataframe_workflows.qmd) | [📝 Data Import/Export](live-coding/4d_data_import_export.qmd) |
: {.hover .bordered tbl-colwidths="[20,40,40]"}

## End-of-day practice
Expand Down
4 changes: 4 additions & 0 deletions docs/cheatsheets.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@
<li>
<a class="dropdown-item" href="./course-materials/interactive-sessions/4a_dataframes.html">
<span class="dropdown-text">Session 4a - 🐼 DataFrames</span></a>
</li>
<li>
<a class="dropdown-item" href="./course-materials/interactive-sessions/4c_dataframe_workflows.html">
<span class="dropdown-text">Session 4c - 🐼 DataFrame Workflows</span></a>
</li>
<li>
<a class="dropdown-item" href="./course-materials/live-coding/4d_data_import_export.html">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@
<li>
<a class="dropdown-item" href="../../course-materials/interactive-sessions/4a_dataframes.html">
<span class="dropdown-text">Session 4a - 🐼 DataFrames</span></a>
</li>
<li>
<a class="dropdown-item" href="../../course-materials/interactive-sessions/4c_dataframe_workflows.html">
<span class="dropdown-text">Session 4c - 🐼 DataFrame Workflows</span></a>
</li>
<li>
<a class="dropdown-item" href="../../course-materials/live-coding/4d_data_import_export.html">
Expand Down Expand Up @@ -479,7 +483,7 @@ <h3 class="anchored" data-anchor-id="task-1-list-operations">Task 1: List Operat
<li>Remove the second fruit from the list.</li>
<li>Print the final list.</li>
</ol>
<div id="e6228ecb" class="cell" data-execution_count="1">
<div id="d1af84ac" 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="co"># Example code for instructor</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a>fruits <span class="op">=</span> [<span class="st">"apple"</span>, <span class="st">"banana"</span>, <span class="st">"cherry"</span>]</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(<span class="st">"Original list:"</span>, fruits)</span>
Expand Down Expand Up @@ -508,7 +512,7 @@ <h3 class="anchored" data-anchor-id="task-2-dictionary-operations">Task 2: Dicti
<li>Update the quantity of an existing item.</li>
<li>Print the final inventory.</li>
</ol>
<div id="6eab0f3b" class="cell" data-execution_count="2">
<div id="e04c6bae" class="cell" data-execution_count="2">
<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><span class="co"># Example code for instructor</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>inventory <span class="op">=</span> {</span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> <span class="st">"apples"</span>: <span class="dv">50</span>,</span>
Expand Down Expand Up @@ -545,7 +549,7 @@ <h3 class="anchored" data-anchor-id="task-3-creating-and-manipulating-sets">Task
<li>Find and print the intersection of the two sets.</li>
<li>Add a new element to the <code>evens</code> set.</li>
</ol>
<div id="af69557b" class="cell" data-execution_count="3">
<div id="5569b42d" class="cell" data-execution_count="3">
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Example code for instructor</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>evens <span class="op">=</span> {<span class="dv">2</span>, <span class="dv">4</span>, <span class="dv">6</span>, <span class="dv">8</span>, <span class="dv">10</span>}</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a>odds <span class="op">=</span> {<span class="dv">1</span>, <span class="dv">3</span>, <span class="dv">5</span>, <span class="dv">7</span>, <span class="dv">9</span>}</span>
Expand Down Expand Up @@ -579,7 +583,7 @@ <h3 class="anchored" data-anchor-id="task-4-set-operations-vs.-list-operations">
<li>Use a list comprehension to remove duplicates.</li>
<li>Print the results of both methods.</li>
</ol>
<div id="cbf13614" class="cell" data-execution_count="4">
<div id="fe539044" class="cell" data-execution_count="4">
<div class="sourceCode cell-code" id="cb7"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Example code for instructor</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>numbers <span class="op">=</span> [<span class="dv">1</span>, <span class="dv">2</span>, <span class="dv">2</span>, <span class="dv">3</span>, <span class="dv">3</span>, <span class="dv">3</span>, <span class="dv">4</span>, <span class="dv">4</span>, <span class="dv">5</span>]</span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a></span>
Expand Down
22 changes: 13 additions & 9 deletions docs/course-materials/answer-keys/3b_control_flows-key.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@
<li>
<a class="dropdown-item" href="../../course-materials/interactive-sessions/4a_dataframes.html">
<span class="dropdown-text">Session 4a - 🐼 DataFrames</span></a>
</li>
<li>
<a class="dropdown-item" href="../../course-materials/interactive-sessions/4c_dataframe_workflows.html">
<span class="dropdown-text">Session 4c - 🐼 DataFrame Workflows</span></a>
</li>
<li>
<a class="dropdown-item" href="../../course-materials/live-coding/4d_data_import_export.html">
Expand Down Expand Up @@ -466,10 +470,10 @@ <h3 class="anchored" data-anchor-id="task-1-simple-weather-advice">Task 1: Simpl
<li>Otherwise, print “Enjoy the pleasant weather!”</li>
</ul></li>
</ol>
<div id="628166c5" class="cell" data-execution_count="1">
<div id="bb034449" class="cell" data-execution_count="1">
<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>temperature <span class="op">=</span> <span class="dv">20</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div id="58ab384b" class="cell" data-execution_count="2">
<div id="65ae3cf8" class="cell" data-execution_count="2">
<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><span class="cf">if</span> temperature <span class="op">&gt;</span> <span class="dv">25</span>:</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(<span class="st">"It's a hot day, stay hydrated!"</span>)</span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="cf">else</span>:</span>
Expand All @@ -493,10 +497,10 @@ <h3 class="anchored" data-anchor-id="task-2-grade-classifier">Task 2: Grade Clas
<li>Below 60: “F”</li>
</ul></li>
</ol>
<div id="5a14f634" class="cell" data-execution_count="3">
<div id="19bc1791" class="cell" data-execution_count="3">
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>score <span class="op">=</span> <span class="dv">85</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div id="cc821faa" class="cell" data-execution_count="4">
<div id="2970819e" class="cell" data-execution_count="4">
<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><span class="cf">if</span> score <span class="op">&gt;=</span> <span class="dv">90</span>:</span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> grade <span class="op">=</span> <span class="st">'A'</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="cf">elif</span> score <span class="op">&gt;=</span> <span class="dv">80</span>:</span>
Expand Down Expand Up @@ -524,7 +528,7 @@ <h3 class="anchored" data-anchor-id="task-3-counting-sheep">Task 3: Counting She
<li>Use a for loop with the range() function</li>
<li>Print each number followed by “sheep”</li>
</ol>
<div id="ecff012c" class="cell" data-execution_count="5">
<div id="a5fede66" class="cell" data-execution_count="5">
<div class="sourceCode cell-code" id="cb8"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> i <span class="kw">in</span> <span class="bu">range</span>(<span class="dv">1</span>,<span class="dv">6</span>):</span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(<span class="ss">f"</span><span class="sc">{</span>i<span class="sc">}</span><span class="ss"> sheep"</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-stdout">
Expand All @@ -544,10 +548,10 @@ <h3 class="anchored" data-anchor-id="task-4-sum-of-numbers">Task 4: Sum of Numbe
<li>Use a for loop with the range() function to add each number to <code>total</code></li>
<li>After the loop, print the total</li>
</ol>
<div id="6b96b4d7" class="cell" data-execution_count="6">
<div id="b1dac5d1" class="cell" data-execution_count="6">
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>total <span class="op">=</span> <span class="dv">0</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div id="d0dcbfc9" class="cell" data-execution_count="7">
<div id="f6a4dce2" class="cell" data-execution_count="7">
<div class="sourceCode cell-code" id="cb11"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> i <span class="kw">in</span> <span class="bu">range</span>(<span class="dv">1</span>,<span class="dv">11</span>):</span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a> total <span class="op">=</span> total <span class="op">+</span> i</span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a></span>
Expand All @@ -569,10 +573,10 @@ <h3 class="anchored" data-anchor-id="task-5-countdown">Task 5: Countdown</h3>
<li>After each print, decrease the countdown by 1</li>
<li>When the countdown reaches 0, print “Blast off!”</li>
</ol>
<div id="b9368eb0" class="cell" data-execution_count="8">
<div id="937e445c" class="cell" data-execution_count="8">
<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>countdown <span class="op">=</span> <span class="dv">5</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div id="38b50f00" class="cell" data-execution_count="9">
<div id="f6ebeff0" class="cell" data-execution_count="9">
<div class="sourceCode cell-code" id="cb14"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="cf">while</span> countdown <span class="op">&gt;</span> <span class="dv">0</span>:</span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(countdown)</span>
<span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a> <span class="co"># (-= is a python syntax shortcut inherited from C)</span></span>
Expand Down
14 changes: 9 additions & 5 deletions docs/course-materials/answer-keys/3d_pandas_series-key.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@
<li>
<a class="dropdown-item" href="../../course-materials/interactive-sessions/4a_dataframes.html">
<span class="dropdown-text">Session 4a - 🐼 DataFrames</span></a>
</li>
<li>
<a class="dropdown-item" href="../../course-materials/interactive-sessions/4c_dataframe_workflows.html">
<span class="dropdown-text">Session 4c - 🐼 DataFrame Workflows</span></a>
</li>
<li>
<a class="dropdown-item" href="../../course-materials/live-coding/4d_data_import_export.html">
Expand Down Expand Up @@ -436,7 +440,7 @@ <h2 class="anchored" data-anchor-id="resources">Resources</h2>
<section id="setup" class="level2">
<h2 class="anchored" data-anchor-id="setup">Setup</h2>
<p>First, let’s import the necessary libraries and create a sample Series.</p>
<div id="4982c0fc" class="cell" data-execution_count="1">
<div id="ae357629" 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> pandas <span class="im">as</span> pd</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> numpy <span class="im">as</span> np</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a></span>
Expand All @@ -459,7 +463,7 @@ <h2 class="anchored" data-anchor-id="exercise-1-creating-a-series">Exercise 1: C
<blockquote class="blockquote">
<p>apple: $0.5, banana: $0.3, cherry: $1.0, date: $1.5, elderberry: $2.0</p>
</blockquote>
<div id="aaf0e8e9" class="cell" data-execution_count="2">
<div id="46360a90" class="cell" data-execution_count="2">
<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><span class="co"># Create a Series called 'prices' with the same index as 'fruits'</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="co"># Use these prices: apple: $0.5, banana: $0.3, cherry: $1.0, date: $1.5, elderberry: $2.0</span></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a>prices <span class="op">=</span> pd.Series([<span class="fl">0.5</span>, <span class="fl">0.3</span>, <span class="fl">1.0</span>, <span class="fl">2.5</span>, <span class="fl">3.0</span>], index<span class="op">=</span>fruits.values, name<span class="op">=</span><span class="st">'Prices'</span>)</span>
Expand All @@ -482,7 +486,7 @@ <h2 class="anchored" data-anchor-id="exercise-2-series-operations">Exercise 2: S
<li>Find the most expensive fruit.</li>
<li>Apply a 10% discount to all fruits priced over 1.0.</li>
</ol>
<div id="5aef5f91" class="cell" data-execution_count="3">
<div id="060da12a" class="cell" data-execution_count="3">
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="co"># 1. Calculate the total price of all fruits</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>total_price <span class="op">=</span> prices.<span class="bu">sum</span>()</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a></span>
Expand Down Expand Up @@ -518,7 +522,7 @@ <h2 class="anchored" data-anchor-id="exercise-3-series-analysis">Exercise 3: Ser
<li>How many fruits cost less than $1.0?</li>
<li>What is the price range (difference between max and min prices)?</li>
</ol>
<div id="aff5d4a2" class="cell" data-execution_count="4">
<div id="6ff93a76" class="cell" data-execution_count="4">
<div class="sourceCode cell-code" id="cb7"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="co"># 1. Calculate the average price of the fruits</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>average_price <span class="op">=</span> prices.mean()</span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a></span>
Expand Down Expand Up @@ -546,7 +550,7 @@ <h2 class="anchored" data-anchor-id="exercise-4-series-manipulation">Exercise 4:
<li>Remove ‘banana’ from both Series.</li>
<li>Sort both Series by fruit name (alphabetically).</li>
</ol>
<div id="8e9da467" class="cell" data-execution_count="5">
<div id="7c3f5a37" class="cell" data-execution_count="5">
<div class="sourceCode cell-code" id="cb9"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="co"># 1. Add 'fig' to both Series (price: $1.2)</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a>fruits <span class="op">=</span> pd.concat([fruits, pd.Series([<span class="st">'fig'</span>], name<span class="op">=</span><span class="st">'Fruits'</span>)])</span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a>prices <span class="op">=</span> pd.concat([prices, pd.Series([<span class="fl">1.2</span>], index<span class="op">=</span>[<span class="st">'fig'</span>], name<span class="op">=</span><span class="st">'Prices'</span>)])</span>
Expand Down
4 changes: 4 additions & 0 deletions docs/course-materials/answer-keys/day6-hw-key.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@
<li>
<a class="dropdown-item" href="../../course-materials/interactive-sessions/4a_dataframes.html">
<span class="dropdown-text">Session 4a - 🐼 DataFrames</span></a>
</li>
<li>
<a class="dropdown-item" href="../../course-materials/interactive-sessions/4c_dataframe_workflows.html">
<span class="dropdown-text">Session 4c - 🐼 DataFrame Workflows</span></a>
</li>
<li>
<a class="dropdown-item" href="../../course-materials/live-coding/4d_data_import_export.html">
Expand Down
4 changes: 4 additions & 0 deletions docs/course-materials/answer-keys/day7-hw-key.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@
<li>
<a class="dropdown-item" href="../../course-materials/interactive-sessions/4a_dataframes.html">
<span class="dropdown-text">Session 4a - 🐼 DataFrames</span></a>
</li>
<li>
<a class="dropdown-item" href="../../course-materials/interactive-sessions/4c_dataframe_workflows.html">
<span class="dropdown-text">Session 4c - 🐼 DataFrame Workflows</span></a>
</li>
<li>
<a class="dropdown-item" href="../../course-materials/live-coding/4d_data_import_export.html">
Expand Down
Loading

0 comments on commit b144815

Please sign in to comment.