Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Рассмотрим данные в общем виде
- pivot_df = pd.pivot_table(
- df,
- index=['purpose_category', 'total_income_category'],
- columns='children',
- values='debt',
- aggfunc=[len, np.sum],
- fill_value=0,
- margins=True
- )
- pivot_df
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement