Guest User

Untitled

a guest
May 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. Region Dist A B C
  2. X T 1 2 0,5
  3. X V 2 2,5 3
  4. Z T 3 5 8,6
  5. Y P 8,6 7,2 3
  6. Y V 4,5 6,5 5
  7. Z V 7 3,3 4,8
  8. Y T 2 1,6 2,2
  9. X P 3 3,3 2,5
  10. Z P 5,5 6 8
  11.  
  12. with pd.ExcelWriter('file.xlsx') as writer:
  13. df.groupby('Region').apply(lambda x: x.to_excel(writer, sheet_name=x.name, index=False))
Add Comment
Please, Sign In to add comment