【问题标题】:How to see all rows of a data frame in a Jupyter notebook with an R kernel?如何在带有 R 内核的 Jupyter 笔记本中查看数据帧的所有行?
【发布时间】:2017-09-09 01:32:02
【问题描述】:

当我将数据框放入单元格时,它只显示部分行,中间有一个“...”。

编辑:我正在寻找这些 Python 笔记本调用的 R 等效项:

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)

另见http://pandas.pydata.org/pandas-docs/stable/generated/pandas.set_option.html

【问题讨论】:

  • 尝试打印输出?例如。 library(plyr); m1 <- ldply(iris, rep, 3); print(m1)
  • 谢谢! “打印”功能删除了漂亮的 HTML 表格格式(排列值、更好看的字体、表格线......)。

标签: r jupyter-notebook jupyter-irkernel


【解决方案1】:

托马斯克鲁伊弗says

我认为您想要的选项是 repr.matrix.max.rows 和 repr.matrix.max.cols

即运行

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

默认值为 60 和 20。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-06
    • 2020-03-11
    • 1970-01-01
    相关资源
    最近更新 更多