In excercise 467-6 the instuction says as following:
- Find the mean price of the cheap apps and assign it to
cheap_mean
. - For only the cheap apps, create a column in
affordable_apps
calledprice_criterion
that takes the value1
when the app’s price is lower thancheap_mean
, and0
otherwise. - As you did in the above example, create a scatter plot for the reasonable apps.
- Run your code without submitting it.
- Conclude that for reasonable apps there also isn’t any significant relationship between price and rating.
- Repeat instructions 1 and 2 for the reasonable apps. Assign the mean to
reasonable_mean
.
And this corresponds with the expected solution
cheap = affordable_apps["Price"] < 5
reasonable = affordable_apps["Price"] >= 5
cheap_mean = affordable_apps.loc[cheap, "Price"].mean()
affordable_apps.loc[cheap, "price_criterion"] = affordable_apps["Price"].apply(
lambda price: 1 if price < cheap_mean else 0
)
affordable_apps[reasonable].plot(kind="scatter", x="Price", y="Rating")
reasonable_mean = affordable_apps.loc[reasonable, "Price"].mean()
affordable_apps.loc[reasonable,"price_criterion"] = affordable_apps["Price"].apply(
lambda price: 1 if price < reasonable_mean else 0
)
affordable_apps[reasonable].plot(kind="scatter", x="Price", y="Rating")
However
points 1 and 2 tell to work on ‘cheap apps’,
then 3 and 5 it jumps to ‘reasonable apps’.
Point 6 instructs to repeat actions 1-2 for reasonable apps.
For me it looks like instruction shall refer to ‘cheap apps’ in points 1-5 and the first plot in solution likewise. Otherwise we have two same plots and instruction is misleading.