Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df = pd.DataFrame({
- 'Date': ['2017-1-1', '2017-1-1', '2017-1-2', '2017-1-2', '2017-1-3'],
- 'Groups1': ['A', 'B', 'C', 'A', 'B'],
- 'Groups2': ['one', 'one', 'one', 'two', 'two'],
- 'Value': range(1, 6)})
- Date Groups1 Groups2 Value
- 0 2017-1-1 A one 1
- 1 2017-1-1 B one 2
- 2 2017-1-2 C one 3
- 3 2017-1-2 A two 4
- 4 2017-1-3 B two 5
- Date Groups1 Groups2 Mean_value
- 0 2017-1-1 A 0 0
- 1 2017-1-2 B 4 1
- 2 2017-1-3 C 5 0
Add Comment
Please, Sign In to add comment