Skip to content

Commit c3383db

Browse files
committed
markdown source builds
Auto-generated via {sandpaper} Source : 2eb021c Branch : main Author : Benjamin Tovar <[email protected]> Time : 2023-05-16 11:43:00 +0000 Message : Merge pull request #552 from btovar/issue_514 Issue 514: clarify iloc and loc
1 parent d16be91 commit c3383db

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

03-index-slice-subset.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,13 @@ surveys_df = pd.read_csv("data/surveys.csv")
283283
We can select specific ranges of our data in both the row and column directions
284284
using either label or integer-based indexing.
285285

286-
- `loc` is primarily *label* based indexing. *Integers* may be used but
287-
they are interpreted as a *label*.
288-
- `iloc` is primarily *integer* based indexing
286+
- `iloc` is primarily an *integer* based indexing counting from 0. That is, your
287+
specify rows and columns giving a number. Thus, the first row is row 0,
288+
the second column is column 1, etc.
289+
290+
- `loc` is primarily a *label* based indexing where you can refer to rows and
291+
columns by their name. E.g., column 'month'. Note that *integers* may be
292+
used, but they are interpreted as a *label*.
289293

290294
To select a subset of rows **and** columns from our DataFrame, we can use the
291295
`iloc` method. For example, we can select month, day and year (columns 2, 3

md5sum.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"episodes/00-before-we-start.md" "0fbbeb717a3a6b613ff472b21bba4e21" "site/built/00-before-we-start.md" "2023-05-08"
88
"episodes/01-short-introduction-to-Python.md" "ae26e8a61fa4277f0c8f895b1bf20cf2" "site/built/01-short-introduction-to-Python.md" "2023-05-16"
99
"episodes/02-starting-with-data.md" "ba84b4e0e6d669a476e206974e8bee56" "site/built/02-starting-with-data.md" "2023-05-16"
10-
"episodes/03-index-slice-subset.md" "4005ea5fbee932f02a74e1e6db1120dd" "site/built/03-index-slice-subset.md" "2023-05-08"
10+
"episodes/03-index-slice-subset.md" "e0492e2a4d0e1a4a3a7bff0268f9b252" "site/built/03-index-slice-subset.md" "2023-05-16"
1111
"episodes/04-data-types-and-format.md" "04fae7c4573d1524b12f0977973151b9" "site/built/04-data-types-and-format.md" "2023-05-08"
1212
"episodes/05-merging-data.md" "3f14de8cbf7239389ba6110ff02523aa" "site/built/05-merging-data.md" "2023-05-08"
1313
"episodes/06-loops-and-functions.md" "812bd4379a6eca318cfee1ec976f946b" "site/built/06-loops-and-functions.md" "2023-05-08"

0 commit comments

Comments
 (0)