Skip to content
Advertisement

Iterate through a dictionary and update dataframe values

i have a dictionary and a df column contains the country code “BHR”,”SAU”,”ARE”..etc

how to update this column so if it find any of the dict keys it will create new column [“TIMEZONE”] row to the dict value. also add if statement that if the row is not equal to the key add a default value

JavaScript

here is my try but it is only updating the last key in the dictionary.

JavaScript

Advertisement

Answer

This is map:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement