BUG:  Groupby on categorical column with date and period producing unexpected result
http://stackoverflow.com/questions/35236880/groupby-on-categorical-column-with-date-and-period-producing-unexpected-result

The issue below was created in Python 2.7.11 with Pandas 0.17.1 (and 0.17.1+311.g70f79ce)

When grouping a categorical column with both a period and date column, unexpected rows appear in the grouping. 

```
df = pd.DataFrame({'date': pd.date_range('2015-12-29', '2016-1-3'), 
                   'val1': [1] * 6, 
                   'val2': range(6), 
                   'cat1': ['a', 'b', 'c'] * 2, 
                   'cat2': ['A', 'B', 'C'] * 2})
df['cat1'] = df.cat1.astype('category')
df['month'] = [d.to_period('M') for d in df.date]
```

Grouping the month and date with a regular series (e.g. cat2) works as expected:

```

>>> df.groupby(['month', 'date', 'cat2']).sum().unstack()
                   val1         val2        
cat2                  A   B   C    A   B   C
month   date                                
2015-12 2015-12-29    1 NaN NaN    0 NaN NaN
        2015-12-30  NaN   1 NaN  NaN   1 NaN
        2015-12-31  NaN NaN   1  NaN NaN   2
2016-01 2016-01-01    1 NaN NaN    3 NaN NaN
        2016-01-02  NaN   1 NaN  NaN   4 NaN
        2016-01-03  NaN NaN   1  NaN NaN   5
```

But grouping on a categorical produces unexpected results. You'll notice in the index that the extra dates do not correspond to the grouped month.

```
>>> df.groupby(['month', 'date', 'cat1']).sum().unstack()
                   val1         val2        
cat1                  a   b   c    a   b   c
month   date                                
2015-12 2015-12-29    1 NaN NaN    0 NaN NaN
        2015-12-30  NaN   1 NaN  NaN   1 NaN
        2015-12-31  NaN NaN   1  NaN NaN   2
        2016-01-01  NaN NaN NaN  NaN NaN NaN  # <<< Extraneous row.
        2016-01-02  NaN NaN NaN  NaN NaN NaN  # <<< Extraneous row.
        2016-01-03  NaN NaN NaN  NaN NaN NaN  # <<< Extraneous row.
2016-01 2015-12-29  NaN NaN NaN  NaN NaN NaN  # <<< Extraneous row.
        2015-12-30  NaN NaN NaN  NaN NaN NaN  # <<< Extraneous row.
        2015-12-31  NaN NaN NaN  NaN NaN NaN  # <<< Extraneous row.
        2016-01-01    1 NaN NaN    3 NaN NaN
        2016-01-02  NaN   1 NaN  NaN   4 NaN
        2016-01-03  NaN NaN   1  NaN NaN   5
```

Grouping the categorical by month periods or dates works fine, but not when both are combined as in the example above.

This behavior originated in the 0.15.0 update. Prior to that, this was the output:

```
>>> df.groupby(['month', 'date', 'cat1']).sum().unstack()
                    val1          val2        
cat1                   a   b   c     a   b   c
month   date                                  
2015-12 2015-12-29     1 NaN NaN     0 NaN NaN
        2015-12-30   NaN   1 NaN   NaN   1 NaN
        2015-12-31   NaN NaN   1   NaN NaN   2
2016-01 2016-01-01     1 NaN NaN     3 NaN NaN
        2016-01-02   NaN   1 NaN   NaN   4 NaN
        2016-01-03   NaN NaN   1   NaN NaN   5


>>> pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Darwin
OS-release: 14.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0+untagged.6557.g123cc73.dirty
nose: 1.3.7
pip: 8.0.2
setuptools: 19.1.1
Cython: 0.22
numpy: 1.10.2
scipy: 0.16.1
statsmodels: None
IPython: 4.0.1
sphinx: 1.3.1
patsy: 0.4.0
dateutil: 1.5
pytz: 2015.7
blosc: None
bottleneck: 1.0.0
tables: 3.1.1
numexpr: 2.4.4
matplotlib: 1.5.0
openpyxl: 2.0.4
xlrd: 0.9.3
xlwt: 1.0.0
xlsxwriter: 0.7.7
lxml: 3.3.4
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.10
pymysql: None
psycopg2: 2.6.1 (dt dec pq3 ext lo64)
jinja2: 2.8
```
