Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see all rows of a data frame in a Jupyter notebook with an R kernel?

When I put a data frame into a cell, it shows only some of the rows, with a "..." in the middle.

Edit: I'm looking for R equivalents of these Python notebook calls:

import pandas
# "If max_cols is exceeded, switch to truncate view"
pandas.set_option('display.max_columns', 5400)
# "The maximum width in characters of a column"
pandas.set_option('display.max_colwidth', 500)

See also http://pandas.pydata.org/pandas-docs/stable/generated/pandas.set_option.html.

like image 355
dfrankow Avatar asked Apr 13 '17 04:04

dfrankow


People also ask

How do I get Jupyter to display all rows?

To show the full data without any hiding, you can use pd. set_option('display. max_rows', 500) and pd.

How do you show row numbers in Jupyter Notebook?

You can enable row numbers in all code cells by pressing Shift + L while no cell is active. If you cannot remember these hotkeys, open the command palette by pressing Control + Shift + P and search for 'line numbers'.


1 Answers

Thomas Kluyver says:

I think the options you want are repr.matrix.max.rows and repr.matrix.max.cols

i.e. run

options(repr.matrix.max.rows=600, repr.matrix.max.cols=200)

The defaults are 60 and 20.

like image 84
dfrankow Avatar answered Oct 01 '22 11:10

dfrankow