Closed
Description
Currently categorical data is converted to full form when made an index.
In [1]: import pandas as pd
In [2]: df = pd.DataFrame({'a': pd.Categorical(['a', 'b', 'a'])},
... index=pd.Categorical(['a', 'b', 'a']))
In [3]: df.dtypes
Out[3]:
a category
dtype: object
In [4]: df.index.dtype
Out[4]: dtype('O')
In [5]: df.index
Out[5]: Index([u'a', u'b', u'a'], dtype='object')
Is there a way around this? I'm trying to keep my DataFrames free of object dtypes to reduce serialization costs. I would like to index off of a text column using categoricals.
This is with 0.15.2