I genuinely don't get why it returns NaN
I have a df and i need to create one more column based on other columns values, this method always worked.
train.loc[(train.region == 'Latin America') & (train.sales_channel == 'Online'), 'expense'] = 47
train.loc[(train.region == 'Latin America') & (train.sales_channel == 'Partnerships'), 'expense'] = 63
train.loc[(train.region == 'Latin America') & (train.sales_channel == 'Direct Sales'), 'expense'] = 89
train.loc[(train.region == 'Europe') & (train.sales_channel == 'Online'), 'expense'] = 69
and i get back this
Try the following