Displaying Grouped_data(Python)

Asked by At

I've used the following code to group a certain variable revenue, in my dataset dd:

group_date=dd.groupby(['Month','Year','PartId'])['revenue'].sum().unstack

Since there are about 20k rows, I would like to observe the groups selectively..say for month=1, year=2010 etc and so on. Is there any code to help me with that? I've tried slicing but it says:

TypeError: 'method' object is not subscriptable

Any help will be appreciated. Thanks a lot.

0 Answers