Created
April 15, 2020 12:55
-
-
Save sam-be/c889c6944c4db96e92238168a887041a to your computer and use it in GitHub Desktop.
[Pandas Print Options] #pandas
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
# 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