Skip to content

Commit

Permalink
markdown source builds
Browse files Browse the repository at this point in the history
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
  • Loading branch information
actions-user committed May 16, 2023
1 parent d16be91 commit c3383db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions 03-index-slice-subset.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,13 @@ surveys_df = pd.read_csv("data/surveys.csv")
We can select specific ranges of our data in both the row and column directions
using either label or integer-based indexing.

- `loc` is primarily *label* based indexing. *Integers* may be used but
they are interpreted as a *label*.
- `iloc` is primarily *integer* based indexing
- `iloc` is primarily an *integer* based indexing counting from 0. That is, your
specify rows and columns giving a number. Thus, the first row is row 0,
the second column is column 1, etc.

- `loc` is primarily a *label* based indexing where you can refer to rows and
columns by their name. E.g., column 'month'. Note that *integers* may be
used, but they are interpreted as a *label*.

To select a subset of rows **and** columns from our DataFrame, we can use the
`iloc` method. For example, we can select month, day and year (columns 2, 3
Expand Down
2 changes: 1 addition & 1 deletion md5sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"episodes/00-before-we-start.md" "0fbbeb717a3a6b613ff472b21bba4e21" "site/built/00-before-we-start.md" "2023-05-08"
"episodes/01-short-introduction-to-Python.md" "ae26e8a61fa4277f0c8f895b1bf20cf2" "site/built/01-short-introduction-to-Python.md" "2023-05-16"
"episodes/02-starting-with-data.md" "ba84b4e0e6d669a476e206974e8bee56" "site/built/02-starting-with-data.md" "2023-05-16"
"episodes/03-index-slice-subset.md" "4005ea5fbee932f02a74e1e6db1120dd" "site/built/03-index-slice-subset.md" "2023-05-08"
"episodes/03-index-slice-subset.md" "e0492e2a4d0e1a4a3a7bff0268f9b252" "site/built/03-index-slice-subset.md" "2023-05-16"
"episodes/04-data-types-and-format.md" "04fae7c4573d1524b12f0977973151b9" "site/built/04-data-types-and-format.md" "2023-05-08"
"episodes/05-merging-data.md" "3f14de8cbf7239389ba6110ff02523aa" "site/built/05-merging-data.md" "2023-05-08"
"episodes/06-loops-and-functions.md" "812bd4379a6eca318cfee1ec976f946b" "site/built/06-loops-and-functions.md" "2023-05-08"
Expand Down

0 comments on commit c3383db

Please sign in to comment.