import pandas as pd
df = pd.DataFrame({'A': ['foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo',
    'foo'], 'B': ['one', 'one', 'two', 'three', 'two', 'two', 'one',
    'three'], 'C': randn(8), 'D': randn(8)})
print(df)
Split a large pandas dataframe