1import pandas as pd
2import numpy as np
3from tabulate import tabulate
4
5def pprint_df(dframe):
6 print tabulate(dframe, headers='keys', tablefmt='psql', showindex=False)
7
8df = pd.DataFrame({'col1': np.random.randint(0, 100, 10),
9 'col2': np.random.randint(50, 100, 10),
10 'col3': np.random.randint(10, 10000, 10)})
11
12pprint_df(df)