Statistics sampling problem

in this sampling problem of WNBA players why wnba is used after the equal sign can somebody please help me with this ??
under_12 = wnba[wnba[‘Games Played’] <= 12]
btw_13_22 = wnba[(wnba[‘Games Played’] > 12) & (wnba[‘Games Played’] <= 22)]
over_23 = wnba[wnba[‘Games Played’] > 22]

proportional_sampling_means =

for i in range(100):
sample_under_12 = under_12[‘PTS’].sample(1, random_state = i)
sample_btw_13_22 = btw_13_22[‘PTS’].sample(2, random_state = i)
sample_over_23 = over_23[‘PTS’].sample(7, random_state = i)

final_sample = pd.concat([sample_under_12, sample_btw_13_22, sample_over_23])
proportional_sampling_means.append(final_sample.mean())

plt.scatter(range(1,101), proportional_sampling_means)
plt.axhline(wnba[‘PTS’].mean())

Hi @hridaydhar15, welcome to the community!

I’m not sure what you’re asking. Do you mean why the code looks like this:

under_12 = wnba[wnba['Games Played'] <= 12]

instead of this:

under_12 = wnba['Games Played'] <= 12

?

If that’s the case, have a look at what each looks like in the variable inspector. Then examine how each of the first 3 variables in the code above are used in the loop. That should help clarify what’s going on there.

If that doesn’t help, could you clarify what you mean to get a better answer?