Skip to content

Commit c4735e3

Browse files
authored
Merge pull request #172 from pryn-kb/main
more pandas corrections
2 parents aca4c27 + 16bbc6a commit c4735e3

27 files changed

+227
-230
lines changed
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
156 Bytes
Binary file not shown.
2.6 KB
Binary file not shown.
0 Bytes
Binary file not shown.
-3.46 KB
Binary file not shown.

_build/html/_sources/docs/pandas/02_Pandas_tabular_data.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@
12101210
"tags": []
12111211
},
12121212
"source": [
1213-
"The `notna()` conditional function returns a `True` for each row where the values ***are not*** a null value (i.e., not `NaN`).\n",
1213+
"The `notna()` conditional function returns a `True` for each row where the values ***are not*** a null value (i.e., not `NaN` or `None`).\n",
12141214
"\n",
12151215
"Use the `notna()` method to create a boolean `DataFrame` indicating whether each element in 'titanic' is not null.\\\n",
12161216
"This command returns a `DataFrame` of the same shape as 'titanic', where `True` indicates a non-null value, and `False` indicates a null value."

_build/html/_sources/docs/pandas/03_Pandas_subsets.ipynb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,21 +1764,21 @@
17641764
"metadata": {},
17651765
"source": [
17661766
"1. Use `loc` to find the passenger named \"Dooley, Mr. Patrick\"\n",
1767-
"2. Use `iloc` to find the ~~alien~~ 8. passenger\n",
1767+
"2. Use `iloc` to find the <del>alien</del> 8. passenger\n",
17681768
"3. Use `iloc` to find the value in row 100, column 4\n",
17691769
"4. Use `loc` and `str.contains()` to find all Reverends (\"Rev.\")\n",
17701770
"\n",
17711771
"```{admonition} Solution\n",
17721772
":class: dropdown\n",
17731773
"\n",
1774-
"1.\n",
1775-
" titanic.loc[titanic['Name'] == \"Dooley, Mr. Patrick\"]\n",
1776-
"2.\n",
1777-
" titanic.iloc[7]\n",
1778-
"3.\n",
1779-
" titanic.iloc[99, 3]\n",
1780-
"4.\n",
1781-
" titanic.loc[titanic['Name'].str.contains(\"Rev.\", case=False)]\n"
1774+
"1. titanic.loc[titanic['Name'] == \"Dooley, Mr. Patrick\"]\n",
1775+
"2. titanic.iloc[7]\n",
1776+
"3. titanic.iloc[99, 3]\n",
1777+
"4. titanic.loc[titanic['Name'].str.contains(\"Rev.\", case=False)]\n",
1778+
"\n",
1779+
"**Solution 4** selects all rows from `titanic` where the **Name** column contains “Rev.”. \n",
1780+
"The argument `case=False` makes the search case-insensitive (it ignores uppercase/lowercase differences). \n",
1781+
"You have not learned about `case=False` yet, and it is not strictly necessary considering the wording of the exercise."
17821782
]
17831783
},
17841784
{

_build/html/_to_be_deleted_later/notebooks.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ <h2>Code blocks and outputs<a class="headerlink" href="#code-blocks-and-outputs"
468468
</div>
469469
</div>
470470
<div class="cell_output docutils container">
471-
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;contextlib.ExitStack at 0x10fbf1100&gt;
471+
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&lt;contextlib.ExitStack at 0x1122a7320&gt;
472472
</pre></div>
473473
</div>
474474
</div>

0 commit comments

Comments
 (0)