I want to create a new column in pandas dataframe. The first column contains names of countries. The list contains countries I am interested in (eg. in EU). The new colum sh
df1["EU"] = np.where(df1["Country"].isin(EU), "EU", "Other")
print (df1)
Capital Country EU
0 Washington USA Other
1 Berlin Germany EU
2 Moscow Russia Other
3 Warsaw Poland EU