Skip to content

Instantly share code, notes, and snippets.

@santiagocasas
Last active March 17, 2020 19:53
Show Gist options
  • Save santiagocasas/ad38d92e228557ff80c9a0bf14ed2da3 to your computer and use it in GitHub Desktop.
Save santiagocasas/ad38d92e228557ff80c9a0bf14ed2da3 to your computer and use it in GitHub Desktop.
counties
country_official_list = (corona_cases_df.index.get_level_values('Country/Region').values)
wanted_countries = ['China', 'Korea','Italy', 'France', 'US']
countries_list = [np.unique(np.array([s for s in country_official_list if cou in s]))
for cou in wanted_countries]
countries_list = np.array(countries_list).flatten()
countries_list.sort()
countries_list
>>>
array(['China', 'France', 'Italy', 'Korea, South', 'US'], dtype='<U12')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment