Created
July 25, 2020 16:02
-
-
Save vnegi10/0f20bbc6ba4638649ccb8dd8cc37c505 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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