groupby FAILS with millisecond grouping across several days
Hello there,

It seems I have hit a weird bug when I was trying to groupby a dataframe having an index made of timestamps

Here is a reproducible example:


```
idx=[pd.to_datetime('2012-02-01 14:00:00') , 
     pd.to_datetime('2012-02-01 14:01:00'),
     pd.to_datetime('2012-03-05 14:01:00'),
     pd.to_datetime('2012-03-05 14:02:00'),
     pd.to_datetime('2012-03-10 14:02:00'),
     pd.to_datetime('2012-03-11 14:02:00')
     ]

test=pd.DataFrame({'value':[1,2,3,4,5,6], 'groups' : ['A','A','A','B','A','A']},index=idx)

test['day'] = test.index.date
test['day'] = pd.to_datetime(test['day'])

test
Out[165]: 
                    groups  value        day
2012-02-01 14:00:00      A      1 2012-02-01
2012-02-01 14:01:00      A      2 2012-02-01
2012-03-05 14:01:00      A      3 2012-03-05
2012-03-05 14:02:00      B      4 2012-03-05
2012-03-10 14:02:00      A      5 2012-03-10
2012-03-11 14:02:00      A      6 2012-03-11
```

Here I define a simple function that groups the dataframe every 200 milliseconds, and computes two variables accordingly


```
def reshaper(dataframe, frequency) :
    local_df = dataframe.groupby(['groups', pd.TimeGrouper(freq =frequency)]).agg(
            {'value' : {'mysum' : 'sum', 'myfunc' : lambda x: -x.sum()}})
    return local_df
```

now, I if try

`reshaper(dataframe = test, frequency = '200 L')`

this takes **FOREVER** and actually fails with some overflow error related to iter error

Instead, applying this function separately every day works like a charm

```
test.groupby('day').apply(lambda x: reshaper(x,  frequency = '200 L'))

Out[176]: 
                                 value       
                                 mysum myfunc
day                                          
2012-02-01 A 2012-02-01 14:00:00     1     -1
             2012-02-01 14:01:00     2     -2
2012-03-05 A 2012-03-05 14:01:00     3     -3
           B 2012-03-05 14:02:00     4     -4
2012-03-10 A 2012-03-10 14:02:00     5     -5
2012-03-11 A 2012-03-11 14:02:00     6     -6
```

Is this a bug? Why would the grouping fail when passing the whole dataframe? _This fail is puzzling because `TimeGrouper` is not like `resample` where a lot of missing values would be created between days._

Any feedback appreciated.
Thanks!

```
pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.13.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: en
LOCALE: None.None

pandas: 0.19.2
nose: 1.3.7
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.25.2
numpy: 1.11.2
scipy: 0.18.1
statsmodels: 0.6.1
xarray: None
IPython: 5.1.0
sphinx: 1.5.1
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: 1.1.0
tables: 3.2.2
numexpr: 2.6.1
matplotlib: 1.5.3
openpyxl: 2.4.0
xlrd: 1.0.0
xlwt: 1.1.2
xlsxwriter: 0.9.6
lxml: 3.7.0
bs4: 4.5.3
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.1.4
pymysql: None
psycopg2: 2.6.2 (dt dec pq3 ext lo64)
jinja2: 2.8
boto: 2.45.0
pandas_datareader: None
```