0

I'm trying to filter down a dataframe in a large dataset and trying to do a replace function to fill in NaN column values. I've write the below code but don't believe I'm structuring it correctly. Any help would be greatly appreciated.

Thanks in advance

df.loc[(df['hotel_code'].isnull()) & (df['region_code'] == 'EMEA') & (df['country'] == 'DE'), 'hotel_type'].fillna("luxury",inplace= True)

I am expecting all hotel_code that is NULL & Region == EMEA & country == DE, to replace filtered fields with 'luxury'.

Bas H
  • 2,114
  • 10
  • 14
  • 23
BPD
  • 3
  • 1

0 Answers0