Skip to content

Commit

Permalink
df description for disc03 problem 1
Browse files Browse the repository at this point in the history
  • Loading branch information
a1ho committed Oct 16, 2024
1 parent dfa17d7 commit 187d72d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions docs/disc03/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,31 @@ <h1 class="title">Discussion 3: Querying, Grouping, and Plotting</h1>
cover can be used for extra practice.</p>
<hr />
<h2 id="problem-1">Problem 1</h2>
<p>The American Kennel Club (AKC) organizes information about dog
breeds. We’ve loaded their dataset into a DataFrame called
<code>df</code>. The index of <code>df</code> contains the dog breed
names as <code>str</code> values.</p>
<p>The columns are:</p>
<ul>
<li><code>'kind' (str)</code>: the kind of dog (herding, hound, toy,
etc.). There are six total kinds.</li>
<li><code>'size' (str)</code>: small, medium, or large.</li>
<li><code>'longevity' (float)</code>: typical lifetime (years).</li>
<li><code>'price' (float)</code>: average purchase price (dollars).</li>
<li><code>'kids' (int)</code>: suitability for children. A value of
<code>1</code> means high suitability, <code>2</code> means medium, and
<code>3</code> means low.</li>
<li><code>'weight' (float)</code>: typical weight (kg).</li>
<li><code>'height' (float)</code>: typical height (cm).</li>
</ul>
<p>The rows of <code>df</code> are arranged in <strong>no particular
order</strong>. The first five rows of <code>df</code> are shown below
(though <code>df</code> has <strong>many more rows</strong> than
pictured here).</p>
<center><img src='../assets/images/su22-final/df.png' width=50%></center>
<p>Assume we have already run <code>import babypandas as bpd</code> and
<code>import numpy as np</code>.</p>
<p><br><br></p>
<p>The following code computes an array containing the unique kinds of
dogs that are heavier than 20 kg <strong>or</strong> taller than 40 cm
on average.</p>
Expand Down
2 changes: 1 addition & 1 deletion pages/disc/disc03.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ context: >
Solutions will be made available after all discussion sections have concluded. You don't need to submit your answers anywhere.<br><br><b>Note: We do not plan to cover all of these problems during the discussion section</b>; the problems we don't cover can be used for extra practice.
show_solution: true
problems:
- su22-final/q3-dog-height-query-probset02
- su22-final/q3-dog-height-query-probset02, su22-final/data-info-disc06
- wi21-midterm/q10-grocery-store-prices-disc03
- wi21-midterm/q5-boolean-array
- wi21-midterm/q6-books-grouping
Expand Down

0 comments on commit 187d72d

Please sign in to comment.