@@ -166,11 +166,11 @@ Suppose the city of Vancouver wants information about Airbnb rentals to help
166
166
plan city bylaws, and they want to know how many Airbnb places are listed as
167
167
entire homes and apartments (rather than as private or shared rooms). Therefore
168
168
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
170
170
do not have access to the true population, but here let's imagine (for learning
171
171
purposes) that our data set represents the population of all Airbnb rental
172
172
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 `
174
174
by using the ` value_counts ` function with the ` normalize ` parameter
175
175
as we did in previous chapters.
176
176
@@ -200,9 +200,9 @@ Instead, perhaps we can approximate it with a small subset of data!
200
200
To investigate this idea, let's try randomly selecting 40 listings (* i.e.,* taking a random sample of
201
201
size 40 from our population), and computing the proportion for that sample.
202
202
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.
206
206
207
207
``` {code-cell} ipython3
208
208
import numpy as np
0 commit comments