To pretty-print an entire Python Pandas Series or DataFram, we use the print
method in the pd.option_context
with
statement.
For instance, we write
with pd.option_context('display.max_rows', None, 'display.max_columns', None):
print(df)
to call pd.option_context
to set some options for printing.
We make Pandas display all the rows and columns with display.max_rows
and display.max_columns
.
And then we call print
with df
to print the values of the series or data frame.