df2 = pandas.DataFrame({'a': ['one', 'one', 'two', 'three', 'two', 'one',
    'six'], 'b': ['x', 'y', 'y', 'x', 'y', 'x', 'x'], 'c': np.random.randn(
    num_rows)})
Python Pandas: how to turn a DataFrame with "factors" into a design matrix for linear regression?