You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi - thank you very much for this run through on world bank data! I found an issue with the data that could have come from a change on the API side over the years. Total population is the one column that gets removed and needs to be recalculated. Quick fix:
`
#pick the dataframe for the country India from the list of dataframes
dfIndia = list_df[1]
#Male Population in any given year=Total Population - Female Population
#validation so that the operation does not fail
if 'Male Population' in dfIndia.columns and 'Female Population' in dfIndia.columns:
# calculate
dfIndia["Total Population"] = dfIndia["Male Population"] + dfIndia["Female Population"]
else:
#print error message
print("One of the columns Total Population or Female Population is missing.")
list_df[1].head()
`
The text was updated successfully, but these errors were encountered:
Hi - thank you very much for this run through on world bank data! I found an issue with the data that could have come from a change on the API side over the years. Total population is the one column that gets removed and needs to be recalculated. Quick fix:
`
#pick the dataframe for the country India from the list of dataframes
dfIndia = list_df[1]
#Male Population in any given year=Total Population - Female Population
#validation so that the operation does not fail
if 'Male Population' in dfIndia.columns and 'Female Population' in dfIndia.columns:
# calculate
dfIndia["Total Population"] = dfIndia["Male Population"] + dfIndia["Female Population"]
else:
#print error message
print("One of the columns Total Population or Female Population is missing.")
list_df[1].head()
`
The text was updated successfully, but these errors were encountered: