I want to align Python dataframe output to center of console or output file. I have tried below code:
import pandas as pd
import os
cols = ('Employee Name','Employee AGE')
df = pd.read_csv("C:/Pawni/Desktop/test.csv",names = cols)
print(df.center(os.get_terminal_size().columns))
But it is giving error : AttributeError: 'DataFrame' object has no attribute 'center'
So, it seems Center is not a attribute of dataframe. What other options available to print dataframe output to center of console.