Expanding column widths
By default, when executed in a Jupyter notebook, pandas results have their columns truncated to about 200px.
This sometimes obscures interesting parts of the results
One way to expand the column widths is to increase the max-width:
from pandas import option_context
with option_context('display.max_colwidth', 400):
display(df.head())
This example expands columns that have long values, up to 400px.
Alternatively, select a small number of rows (for example via head()) and print the transpose:
display(df.head().T)
Expanding row counts
similarly, more rows can be displayed via this setting:
pd.set_option('display.max_rows', 500)
Comments
Post a Comment