Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Region Dist A B C
- X T 1 2 0,5
- X V 2 2,5 3
- Z T 3 5 8,6
- Y P 8,6 7,2 3
- Y V 4,5 6,5 5
- Z V 7 3,3 4,8
- Y T 2 1,6 2,2
- X P 3 3,3 2,5
- Z P 5,5 6 8
- with pd.ExcelWriter('file.xlsx') as writer:
- df.groupby('Region').apply(lambda x: x.to_excel(writer, sheet_name=x.name, index=False))
Add Comment
Please, Sign In to add comment