@DishinGoyani thank you for the answer, I understand that is the same answer provided in the exercise.
However, may you explain why my code doesn’t work? I thought writing affordable_apps[cheap][‘Price’].apply() would help filter the columns within price_criterion. Is there a way to write my code to make it work?
Expression on right hand side is correct but issue is in left hand side (While assigning result to column)
Both time you are using affordable_apps['price_criterion'] = ... that will replace all column instead of altering only cheap rows. To made it only change cheap rows we will need to pass boolean index on left hand side. like affordable_apps.loc[cheap, 'price_criterion'] = ... so only cheap rows get alter. and the same for reasonable rows.