After using df.groupby(df.index.month)
I would like to preview my DataFrame
unfortunately .head
removes the group formatting and df[
you can loop through test
test = df.groupby("columnTitle")
for each in test:
print each[0] #columnTitle value
print each[1] #corresponding df equivalent of df[df['columnTitle']==each[0]]
Something like this? gb
is the GroupBy object. This prints the first 5 rows from the first 3 groups.
In [230]: gb = df.groupby(df.index.month)
In [231]: for k in gb.groups.keys()[:3]:
...: print gb.get_group(k)[:5]