Performance of `lambda` function in groupby
Hi,

I came across an unknown-to-me behaviour in the performance of `groupby` (I was suggested to put the question here after a thread on [stackoverflow](http://stackoverflow.com/questions/38496930/performance-of-groupby-when-dealing-with-category-type-in-pandas).

```
import pandas as pd
import numpy as np

a = np.random.choice(['a', 'A'], size=100000)
b = np.random.choice(range(10000), size=100000)

df = pd.DataFrame(data=dict(A=a, B=b))
```

The performance between the genuine `nunique` function and the 'lambda version' if it is totally different

```
%%timeit
df_ = df.groupby(by='B').A.nunique()

10 loops, best of 3: 60.9 ms per loop
```

```
%%timeit
df_ = df.groupby(by='B').agg(
    dict(
        A=lambda s: s.nunique()
    )
)

1 loop, best of 3: 981 ms per loop
```

Is it an expected behaviour?

Best regards,
F.
