python dataframe show all columns code example

Example 1: python show all columns

pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)

Example 2: pd.set_option('display.max_columns', None)

pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
#used for expanding the no o viible columns of dataframe

Example 3: pandas print all columns

# This will print all columns and rows
# 'display.max_colwidth', -1  will print entire row content

pd.set_option("display.max_rows", None, "display.max_columns", None,'display.max_colwidth', -1)

Example 4: view all columns in pandas dataframe

pd.options.display.max_columns = None
pd.options.display.max_rows = None

Example 5: view all columns pandas

print(dataframe.columns)