Skip to content

Instantly share code, notes, and snippets.

@vnegi10
Created July 25, 2020 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vnegi10/0f20bbc6ba4638649ccb8dd8cc37c505 to your computer and use it in GitHub Desktop.
Save vnegi10/0f20bbc6ba4638649ccb8dd8cc37c505 to your computer and use it in GitHub Desktop.
function find_country(data_df,country::String)
data_df_new = data_df[ismissing.(data_df[!,Symbol("Province/State")]), :] # keep only rows with missing entry for "Province/State", total numbers for countries can be read this way
loc = findfirst(data_df_new[!,Symbol("Country/Region")] .== country) # find the index of the row containing country
return data_df_new[loc,:] # select the matching row
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment