If you want to pretty print the data frames, then you can use tabulate package.
import pandas as pd
import numpy as np
from tabulate import tabulate
def pprint_df(dframe):
print tabulate(dframe, headers='keys', tablefmt='psql', showindex=False)
df = pd.DataFrame({'col1': np.random.randint(0, 100, 10),
'col2': np.random.randint(50, 100, 10),
'col3': np.random.randint(10, 10000, 10)})
pprint_df(df)
Specifically, the showindex=False
, as the name says, allows you to not show index. The output would look as follows:
+--------+--------+--------+
| col1 | col2 | col3 |
|--------+--------+--------|
| 15 | 76 | 5175 |
| 30 | 97 | 3331 |
| 34 | 56 | 3513 |
| 50 | 65 | 203 |
| 84 | 75 | 7559 |
| 41 | 82 | 939 |
| 78 | 59 | 4971 |
| 98 | 99 | 167 |
| 81 | 99 | 6527 |
| 17 | 94 | 4267 |
+--------+--------+--------+