In [1]: import pandas as pd
import numpy as np
In [2]: df = pd.DataFrame(np.random.choice(['foo','bar','baz'], size=(100000,3)))
df = df.apply(lambda col: col.astype('category'))
In [3]: df.head()
Out[3]:
0 1 2
0 bar foo baz
1 baz bar baz
2 foo foo b...