mirror of
https://github.com/wahyd4/code-sandbox.git
synced 2026-08-09 05:07:03 +10:00
17 lines
360 B
Python
17 lines
360 B
Python
import pandas as pd
|
|
import numpy as np
|
|
import seaborn as sns
|
|
import matplotlib.pyplot as plt
|
|
import matplotlib as mpl
|
|
|
|
sns.set()
|
|
|
|
births = pd.read_csv("data/births.csv")
|
|
births["decade"] = 10 * (births["year"] // 10)
|
|
|
|
|
|
births.pivot_table("births", index="year", columns="gender", aggfunc="sum").plot()
|
|
plt.ylabel("total births per year")
|
|
|
|
plt.show(block=True)
|