First thanks so much to those who help, it's fun learning when people can help.
I haven't got slicing and selecting down, i have a dataframe with
Unit Name Count Month Year
2013-01-01 U1 fn ln 2 01 2013
2013-01-01 U1 fn1 ln1 200 01 2013
2013-02-01 U2 fn2 ln2 55 01 2013
...
2016-01-01 U1 fn3 ln3 2 01 2016
2016-01-01 U1 fn1 ln1 200 01 2016
2016-01-01 U2 fn5 ln5 55 01 2016
I want to create various slices of this data.
First is an overall per month, next is overall per month per unit, then individual for this month, last three months, and last 6 months
code so far
# this works great groups by year per month (1 2013, 2014, 2015)...
group1=df.groupby('Month','Year')
# works great to select by unit
group2=df.groupby('Unit', 'Month', 'Year')
# now i want the top 10 individuals in each group
# this doesn't work
month_indiv = group2[['Name', 'Count']]
I think the issue is that groupby removes duplicates but i don't understand how to create the view that gives me the individuals.