[Solved] How to check whether data of a row is in list, inside of np.where()?


You can use .isin() directly in pandas filtering –

recent_indicators_filtered = recent_indicators[recent_indicators['CountryCode'].isin(developed_countries)]

Also, you can come up with a boolean column that says True if developed –

recent_indicators['Developed'] = recent_indicators['CountryCode'].isin(developed_countries)

solved How to check whether data of a row is in list, inside of np.where()?