Last active
September 22, 2021 18:48
-
-
Save wassname/cfb9a1780af119327440b832ae270c2c to your computer and use it in GitHub Desktop.
show a pandas data frame in full
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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