Skip to content

Instantly share code, notes, and snippets.

@wassname
Last active September 22, 2021 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wassname/cfb9a1780af119327440b832ae270c2c to your computer and use it in GitHub Desktop.
Save wassname/cfb9a1780af119327440b832ae270c2c to your computer and use it in GitHub Desktop.
show a pandas data frame in full
from IPython.display import display
import pandas as pd
def pdshow(df):
"""
This shows a pandas dataframe in full/
Also consider .to_html() and https://pbpython.com/dataframe-gui-overview.html
Usage:
pdshow(df.sample(10))
From: https://gist.github.com/wassname/cfb9a1780af119327440b832ae270c2c
See https://pandas.pydata.org/pandas-docs/stable/user_guide/options.html
"""
with pd.option_context("display.max_rows", 10, "display.max_columns", 2500, "display.max_colwidth", 160, "display.width", 2000,):
display(df)
# pdshow(d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment