Exploring Data with pandas: Fundamentals, 10/14 problem

Hello,
Could you please help me understand why that code works:
f500.loc[f500[‘previous_rank’] == 0, ‘previous_rank’] = np.nan
and this one not:
f500[f500[‘previous_rank’] == 0].loc[:,‘previous_rank’] = np.nan
no error but values wont change to Nan