Suppose if I have a data like the following,with Name, class and Date
Name class Date
A 7th grade 1/1/2016
A 7th grade 1/2/2016
A 7th grade 1/3/2016
A 7th grade 1/4/2016
A 7th grade 1/5/2016
A 7th grade 1/6/2016
A 7th grade 1/7/2016
B 8th grade 1/8/2016
B 8th grade 1/9/2016
B 8th grade 1/10/2016
C 9th grade 1/11/2016
C 9th grade 1/12/2016
C 9th grade 1/13/2016
C 9th grade 1/14/2016
C 9th grade 1/15/2016
C 9th grade 1/16/2016
C 9th grade 1/17/2016
C 9th grade 1/18/2016
C 9th grade 1/19/2016
C 9th grade 1/20/2016
C 9th grade 1/21/2016
C 9th grade 1/22/2016
I am looking for a output which would give me the count of values for each name, their respective grade and the earliest date and the latest date. My output would be,
Name grade count earlydate latestdate
A 7thgrade 7 1/1/2016 1/7/2016
B 8th grade 3 1/8/2016 1/10/2016
C 9th grade 12 1/11/2016 1/22/2016
I am able to find the counts of each name by,
data.groupby('name','grade').count()
or
data.groupby('name','grade').size()
But not able to find the early date and latest date inside the date column.
Can anybody help me in dng this?