Skip to content

Commit 32e7f1a

Browse files
minor polish where seed first used
1 parent e33734d commit 32e7f1a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/inference.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ Suppose the city of Vancouver wants information about Airbnb rentals to help
166166
plan city bylaws, and they want to know how many Airbnb places are listed as
167167
entire homes and apartments (rather than as private or shared rooms). Therefore
168168
they may want to estimate the true proportion of all Airbnb listings where the
169-
room type is listed as "entire home or apartment." Of course, we usually
169+
"type of place" is listed as "entire home or apartment." Of course, we usually
170170
do not have access to the true population, but here let's imagine (for learning
171171
purposes) that our data set represents the population of all Airbnb rental
172172
listings in Vancouver, Canada.
173-
We can find the proportion of listings for each room type
173+
We can find the proportion of listings for each `room_type`
174174
by using the `value_counts` function with the `normalize` parameter
175175
as we did in previous chapters.
176176

@@ -200,9 +200,9 @@ Instead, perhaps we can approximate it with a small subset of data!
200200
To investigate this idea, let's try randomly selecting 40 listings (*i.e.,* taking a random sample of
201201
size 40 from our population), and computing the proportion for that sample.
202202
We will use the `sample` method of the `pandas.DataFrame`
203-
object to take the sample. The argument `n` of `sample` is the size of the sample to take
204-
and since we are starting to use randomness here,
205-
we are also setting the random seed via numpy to make the results reproducible.
203+
object to take the sample. The argument `n` of `sample` is the size of the sample to take.
204+
Note that since we are using randomness in this chapter,
205+
we need to set the random seed to make the results reproducible.
206206

207207
```{code-cell} ipython3
208208
import numpy as np

0 commit comments

Comments
 (0)