You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/intro.md
+12-2
Original file line number
Diff line number
Diff line change
@@ -553,7 +553,7 @@ Fortunately, `pandas` provides the `loc[]` operation, which lets us do just that
553
553
The syntax is very similar to the `[]` operation we have already covered: we will
554
554
essentially combine both our row filtering and column selection steps from before.
555
555
In particular, we first write the name of the data frame---`can_lang` again---then follow
556
-
that with the `.loc[]`method. Inside the square brackets,
556
+
that with the `.loc[]`operation. Inside the square brackets,
557
557
we write our row filtering logical statement,
558
558
then a comma, then our list of columns to select.
559
559
@@ -576,7 +576,17 @@ and wrote `pd.read_csv`. The dot means that the thing on the left (`pd`, i.e., t
576
576
thing on the right (the `read_csv` function). In the case of `can_lang.loc[]`, the thing on the left (the `can_lang` data frame)
577
577
*provides* the thing on the right (the `loc[]` operation). In Python,
578
578
both packages (like `pandas`) *and* objects (like our `can_lang` data frame) can provide functions
579
-
and other objects that we access using the dot syntax.
579
+
and other objects that we access using the dot syntax.
580
+
581
+
```{note}
582
+
A note on terminology: when an object `obj` provides a function `f` with the
583
+
dot syntax (as in `obj.f()`), sometimes we call that function `f` a *method* of `obj` or an *operation* on `obj`.
584
+
Similarly, when an object `obj` provides another object `x` with the dot syntax (as in `obj.x`), sometimes we call the object `x` an *attribute* of `obj`.
585
+
We will use all of these terms throughout the book, as you will see them used commonly in the community.
586
+
And just because we programmers like to be confusing for no apparent reason: we *don't* use the "method", "operation", or "attribute" terminology
587
+
when referring to functions and objects from packages, like `pandas`. So for example, `pd.read_csv`
588
+
would typically just be referred to as a function, but not as a method or operation, even though it uses the dot syntax.
589
+
```
580
590
581
591
At this point, if we have done everything correctly, `aboriginal_lang` should be a data frame
582
592
containing *only* rows where the `category` is `"Aboriginal languages"`,
0 commit comments