Communicating Results - Step 7 (do, aff, gc variables - apply function)

Good morning to all
Allthough it seems that most of the people have problems with multiindexing, my problem is that I can not understand the use of the apply function. What do aff,gc and price variables represent and what does aplly function do in this case?

<def label_genres(row):
“”“For each segment in genres_mean,
labels the apps that cost less than its segment’s mean with 1
and the others with 0.”""

aff = row["affordability"]
gc = row["genre_count"]
price = row["Price"]

if price < genres_mean.loc[(aff, gc)][0]:
    return 1
else:
    return 0

affordable_apps[“genre_criterion”] = affordable_apps.apply(
label_genres, axis=“columns”
)>

Thank you in advance

Hi @gregoracius and welcome back to the community!

Without context, it is a little difficult to understand what your question is. Can you take a look at this post and update your question accordingly? In particular, please provide a link to the mission you’re having difficulty with so that others can experiment with your code in order to help you.