Guest User

Untitled

a guest
Jun 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. df = pd.DataFrame({
  2. 'Date': ['2017-1-1', '2017-1-1', '2017-1-2', '2017-1-2', '2017-1-3'],
  3. 'Groups1': ['A', 'B', 'C', 'A', 'B'],
  4. 'Groups2': ['one', 'one', 'one', 'two', 'two'],
  5. 'Value': range(1, 6)})
  6.  
  7. Date Groups1 Groups2 Value
  8. 0 2017-1-1 A one 1
  9. 1 2017-1-1 B one 2
  10. 2 2017-1-2 C one 3
  11. 3 2017-1-2 A two 4
  12. 4 2017-1-3 B two 5
  13.  
  14. Date Groups1 Groups2 Mean_value
  15. 0 2017-1-1 A 0 0
  16. 1 2017-1-2 B 4 1
  17. 2 2017-1-3 C 5 0
Add Comment
Please, Sign In to add comment