Skip to content

Commit c441c83

Browse files
authored
Update invalid pandas indexing statement (#580)
1 parent 870bd31 commit c441c83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

episodes/03-index-slice-subset.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ selects the element that is 3 rows down and 7 columns over in the DataFrame.
390390
It is worth noting that rows are selected when using `loc` with a single list of
391391
labels (or `iloc` with a single list of integers). However, unlike `loc` or `iloc`,
392392
indexing a data frame directly with labels will select columns (e.g.
393-
`surveys_df['species_id', 'plot_id', 'weight']`), while ranges of integers will
393+
`surveys_df[['species_id', 'plot_id', 'weight']]`), while ranges of integers will
394394
select rows (e.g. surveys\_df[0:13]). Direct indexing of rows is redundant with
395395
using `iloc`, and will raise a `KeyError` if a single integer or list is used; the
396396
error will also occur if index labels are used without `loc` (or column labels used

0 commit comments

Comments
 (0)