Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import pandas as pd
- import matplotlib.pyplot as plt
- import seaborn as sns
- from scipy import stats
- da = pd.read_csv("C:/Users/eli/Desktop/YtPruboBEemdqA7UJJ_tgg_63e179e3722f4ef783f58ff6e395feb7_nhanes_2015_2016.csv")
- da["agegrp"] = pd.cut(da.RIDAGEYR, [18, 30, 40, 50, 60, 70, 80])
- b = da.groupby(["RIAGENDR", "RIDRETH1"]).size().unstack().fillna(0).apply(lambda x: x/x.sum(), axis=1)
- print(b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement