Changes
Jump to navigation
Jump to search
← Older edit
Pandas gapminder
(edit)
Revision as of 10:45, 21 May 2019
89 bytes added
,
10:45, 21 May 2019
m
no edit summary
Line 5:
Line 5:
</syntaxhighlight><syntaxhighlight lang="python3">
</syntaxhighlight><syntaxhighlight lang="python3">
from gapminder import gapminder as df
from gapminder import gapminder as df
+
import matplotlib.pyplot as plt
+
df.groupby('year')['lifeExp'].mean()
df.groupby('year')['lifeExp'].mean()
Line 15:
Line 17:
global_yearly_life_expectancy = df.groupby('year')['lifeExp'].mean()
global_yearly_life_expectancy = df.groupby('year')['lifeExp'].mean()
+
+
# Plot
+
global_yearly_life_expectancy.plot()
+
plt.show()
</syntaxhighlight>
</syntaxhighlight>
Rafahsolis
Bureaucrats
,
Administrators
2,306
edits
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version