Skip to content

Instantly share code, notes, and snippets.

@sam-be
Created April 15, 2020 12:55
Show Gist options
  • Save sam-be/c889c6944c4db96e92238168a887041a to your computer and use it in GitHub Desktop.
Save sam-be/c889c6944c4db96e92238168a887041a to your computer and use it in GitHub Desktop.
[Pandas Print Options] #pandas
# Change the maximum number of rows and columns printed. (`None` means unlimited).
pd.set_option('max_rows', 2) # Default is 60 rows
pd.set_option('max_columns', 2) # Default is 20 columns
# Reset the options to defaults.
pd.reset_option('max_rows')
pd.reset_option('max_columns')
# Change the options temporarily. (Settings are restored when you exit the `with` block).
with pd.option_context('max_rows', None, 'max_columns', None):
print(df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment