String Vs Variable Index

Screen Link: <Learn data science with Python and R projects

Quick question:
Why is the reasonable/cheap label in ‘variable’ format and not string?

Correct answer:

affordable_apps.loc[reasonable,"price_criterion"] = affordable_apps["Price"].apply(
    lambda price: 1 if price < reasonable_mean else 0
)

Code i sent:

affordable_apps.loc[['reasonable'],['price_criterion']] = affordable_apps['Price'].apply(lambda price: 1 if price < reasonable_mean else 0)

Because it’s not a string -

reasonable = affordable_apps["Price"] >= 5

It’s a Boolean Series that is used to index affordable_apps. I would suggest going through the Exploring Data with Pandas: Intermediate Mission to review boolean indexing in Pandas.