-
-
Save zachlim98/bb641b2cca0f554040e8374aea8a12a0 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
pop = 7.594 #in billions | |
growth_rate = 1.0124 | |
yearlist = [] | |
poplist = [] | |
for i,d in enumerate(np.arange(2021,2051)): | |
year = d | |
pop = pop * growth_rate**(i+1) | |
yearlist.append(year) | |
poplist.append(pop) | |
pop_growth = pd.DataFrame( | |
{ | |
"Year" : yearlist, | |
"Population" : poplist | |
} | |
) | |
plt.plot(pop_growth.Year, pop_growth.Population) | |
plt.xlabel("Year") | |
plt.ylabel("Population Size") | |
plt.title("World Population Projected Growth") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment