Edamame
Edamame

Reputation: 25366

Jupyter Notebook: need to review all cells in a data frame

I am using Jupyter notebook, having a python data frame of 100 columns and 200 rows. I need to manually review every cell in the data frame, but on the browser, it just show "..." when the row or column numbers are large. Can I force it to show every row and column instead of just showing "..."?

Thanks!

Upvotes: 2

Views: 673

Answers (2)

dot.Py
dot.Py

Reputation: 5157

You must configure the display.max_rows and/or display.max_columnsusing pd.set_option().

I.e.:

def print_all(x):
    pd.set_option('display.max_rows', len(x))
    pd.set_option('display.max_columns', len(x.columns))

    print(x)

    pd.reset_option('display.max_rows')
    pd.reset_option('display.max_columns')

Upvotes: 4

Bruce Pucci
Bruce Pucci

Reputation: 1901

You need to specify how many rows you want shown. You can configure those options in a notebook like this...

pd.set_option('display.max_column', 999)
pd.set_option('display.max_row', 999)

where 999 is the number of rows/columns to be shown

Upvotes: 1

Related Questions