During our data exploration, there are often times that too many data columns in the dataframe. By default, the Jupyter Notebook only display a handful of it for simplicity.
Here is the couple of ways to display all the columns:
import pandas as pd
from IPython.display import display
data = pd.read_csv(‘mydave.cvs’)
# Direclty set the options
pd.options.display.max_columns = None
display(data)
Or, you set_option method from pandas.
pd.set_option(‘display.max_columns’, None)
display(data)
To locally change the setting for an only specific cell, do the following:
with pd.option_context(‘display.max_columns’,None):
display(data)
You can also do:
from IPython.display import HTML
HTML(data.to_html())