list_1 = ["Iceland", "Norway", "Sweden", "Finland","Denmark","United Kingdom", "Ireland",
"France", "Belgium","Netherlands", "Luxembourg","Monaco", "Portugal", "Spain",
"Andorra", "Italy","Malta","San Marino", "Vatican City", "Germany",
"Switzerland", "Liechtenstein"," Austria", "Poland", "Czech Republic", "Slovakia",
"Hungary","Slovenia","Croatia", "Bosnia" ,"Herzegovina", "Serbia", "Montenegro",
"Albania", "Macedonia", "Romania", "Bulgaria","Greece", "Estonia", "Latvia",
"Lithuania", "Belarus", "Ukraine", "Moldova"]
list_2 = ['Brazil' , 'Canada' , 'Peru' , 'Chile', 'South America']
list_3 = ['Afghanistan', 'Armenia', 'Azerbaijan', 'Bahrain' ,'Bangladesh', 'Bhutan',
'Brunei', 'Burma', 'Cambodia', 'China', 'East Timor','Georgia', 'Hong Kong',
'India' , 'Indonesia', 'Iran' , 'Iraq' ,'Israel' , 'Japan','Jordan', 'Kazakhstan',
'Kuwait' , 'Kyrgyzstan' , 'Laos', 'Lebanon', 'Malaysia' , 'Mongolia', 'Nepal',
'North Korea', 'Oman', 'Pakistan','Papua New Guinea', 'Philippines', 'Qatar',
'Saudi Arabia','Singapore', 'South Korea', 'Sri Lanka', 'Syria', 'Taiwan'
'Tajikistan', 'Thailand', 'Turkey', 'Turkmenistan','United Arab Emirates',
'Uzbekistan', 'Vietnam', 'Yemen']
list_4 = ['United States']
list_5 = ['South Africa','Egypt' , 'Morocco' , 'Algeria' , 'Ghana', 'Africa', "Egypt"]
conditions = [
(df['Entity'].isin(list_4)),
(df['Entity'].isin(list_2)),
(df['Entity'].isin(list_5)),
(df['Entity'].isin(list_3)),
(df['Entity'].isin(list_1))
]
choices = ['US',"Rest of America","Africa","Asia","Europe"]
Region = np.select(conditions, choices, default='Rest of the world')