I have a couple of questions about the group by function. 1. I would like to group by pandas data frame by single column without aggregation. 2. After group by, I would like to split the dataset into several datasets by the month date. So, I wasn't able to do so, I am requesting help. I would appreciate it if you guys can help me. I have provided the code, expected results, and dataset below.
Original dataframe
data = {'month': ['2022-01-01', '2022-02-01', '2022-03-01', '2022-01-01', '2022-02-01', '2022-03-01', '2022-01-01', '2022-02-01', '2022-03-01',],
'Name': ['A', 'A', 'A', 'B', 'B', 'B', 'C', 'C', 'C'],
'num': [1234, 1234, 1234, 456, 456, 456, 456, 100, 200,],
}
df = pd.DataFrame(data)
df
Expected Result for question #1
And I want to split the dataset into different datasets like this
Expected Result for question #2
Thank You