Skip to content

Commit eb5a1b6

Browse files
committed
differences for PR #59
1 parent dfe28f6 commit eb5a1b6

File tree

3 files changed

+26
-25
lines changed

3 files changed

+26
-25
lines changed

07-pandas_essential.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,15 @@ or:
128128
print(data.iloc[0, :])
129129
```
130130

131-
The `:` character by itself is shorthand to indicate all elements across that indice, but it can also be combined with index values or column headers to specify a slice of the DataArray:
131+
Note that here we knew that Albania was the first country in the DataFrame, so we were able to ask for the first column (0). If you needed to know the column ID for a particular country, you could do this using `get_loc()`, e.g. `data.index.get_loc("France")` should tell you the column ID value for France.
132+
133+
The `:` character by itself is shorthand to indicate all elements across that index, but it can also be combined with index values or column headers to specify a slice of the DataArray:
132134

133135
```python
134136
print(data.loc["Albania", 'gdpPercap_1962':'gdpPercap_1972'])
135137
```
136138

137-
If either end of the slice definition is omitted, then the slice will run to the end of that indice (just as it does for `:` by itself):
139+
If either end of the slice definition is omitted, then the slice will run to the end of that index (just as it does for `:` by itself):
138140

139141
```python
140142
print(data.loc["Albania", 'gdpPercap_1962':])

md5sum.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"episodes/04-software_package_management.md" "62db2ba2a4291e16d2bdd07b77bfc961" "site/built/04-software_package_management.md" "2025-04-15"
1111
"episodes/05-defensive_programming.md" "357bca7361e09066ad71393e21ad0c74" "site/built/05-defensive_programming.md" "2025-04-15"
1212
"episodes/06-units_and_quantities.md" "aa0215a27f41d8c99db495c727c56051" "site/built/06-units_and_quantities.md" "2025-11-17"
13-
"episodes/07-pandas_essential.md" "5dde09b1125f8c30156ae314b5fdcfe1" "site/built/07-pandas_essential.md" "2025-04-15"
13+
"episodes/07-pandas_essential.md" "0c2191b28472f7f4f1fcfe829aaa59d5" "site/built/07-pandas_essential.md" "2026-04-10"
1414
"instructors/instructor-notes.md" "a59fd3b94c07c3fe3218c054a0f03277" "site/built/instructor-notes.md" "2025-04-15"
1515
"learners/discuss.md" "2758e2e5abd231d82d25c6453d8abbc6" "site/built/discuss.md" "2025-04-15"
1616
"learners/reference.md" "28853696c21dd22dfb883e9c241e95fb" "site/built/reference.md" "2025-04-15"
1717
"learners/setup.md" "b49173664b6f5d6f31f11fb8bf67f620" "site/built/setup.md" "2025-04-15"
1818
"profiles/learner-profiles.md" "60b93493cf1da06dfd63255d73854461" "site/built/learner-profiles.md" "2025-04-15"
19-
"renv/profiles/lesson-requirements/renv.lock" "db0fb2ee29e76e6cf403b8e7be6bbb50" "site/built/renv.lock" "2025-11-11"
19+
"renv/profiles/lesson-requirements/renv.lock" "27e4855ba3f7161ae21bda4f9d207141" "site/built/renv.lock" "2026-04-10"

0 commit comments

Comments
 (0)