Use a category when there are many repetitions that you expect to use.
For example, suppose I want the total size for an exchange for a large trading table. Using the standard objectis quite reasonable:
In [6]: %timeit trades.groupby('exch')['size'].sum()
1000 loops, best of 3: 1.25 ms per loop
, , , category:
In [7]: trades['exch'] = trades['exch'].astype('category')
In [8]: %timeit trades.groupby('exch')['size'].sum()
1000 loops, best of 3: 702 µs per loop
, - . , .