def country_to_continent(country_name):country_alpha2 = pc.country_name_to_country_alpha2(country_name)country_continent_code = pc.country_alpha2_to_continent_code(country_alpha2)country_continent_name = pc.convert_continent_code_to_continent_name(country_continent_code)return country_continent_name
countries = list(df['country'])[country_to_continent(country)for country in countries]
def country_to_continent(country_name):country_alpha2 = pc.country_name_to_country_alpha2(country_name)country_continent_code = pc.country_alpha2_to_continent_code(country_alpha2)country_continent_name = pc.convert_continent_code_to_continent_name(country_continent_code)return country_continent_namecountry_name = list(df['country'])
country_to_continent(country_name)
Acutually I can't get it why my second one is wrong but the first one is right . and get unhashable error