for i in arange(30):
    df = pd.DataFrame(np.random.randn(n, c), columns=list(map(chr, list(range(65,
        65 + c)))))
df['key'] = string.ascii_letters[i]
df.to_sql(name='test_table', if_exists='append', con=conn)
Group By operation for large dataset