GroupBy apply method is calling passed function multiple times for the same group?
There are two groups below, so I expected the function `f` to be called only twice, but you can see in the output below, it was called 3 times.

I am using version 0.13.0rc1-92-gf6fd509

Code

```
import pandas as pd
from cStringIO import StringIO

# get sample dataframe
s = '''Col1 Col2 Col3
1 1 1
1 2 2
3 3 3'''
df = pd.read_csv(StringIO(s), sep=' ')

# to count how many times f is called
i = 0

# given the dataframe above, shouldn't this be called only twice?
def f(df):
    global i
    i += 1
    print '[%d] Calling function' % i
    print 'Performing complex aggregation'
    return 'Using result %d' % i

print df.groupby('Col1').apply(f)
```

Output

```
[1] Calling function
Performing complex aggregation
[2] Calling function
Performing complex aggregation
[3] Calling function
Performing complex aggregation
Col1
1       Using result 2
3       Using result 3
dtype: object
```
