list = ['Japan', 'France', 'United States']
要比较具有列名place键'country'和值''的列表仅获取具有与列表中的国家/地区相似的国家/地区的行
数据框看起来像这样:
Id Place
767 {'country_code': 'US','country': 'United States'}
645 {'country_code': 'IRL','country': 'Ireland'}
324 {'country_code': 'JAP','country': 'Japan'}
我用过这个:
for i in range(0,len(df['place'])):
df['place'][0]["country"].isin(list)