[英]Is there a way to print python datatable without waiting for user input at the end
I am printing a python datatable Frame.我正在打印一个 python 数据表框架。 It pages when I do that, it's waiting for my input at the end, even for very small Frames.当我这样做时它会翻页,它会在最后等待我的输入,即使对于非常小的框架也是如此。 For example,例如,
In [12]: DT = dt.Frame(A=range(5))
In [13]: DT
A
--- --
0 0
1 1
2 2
3 3
4 4
[5 rows x 1 column]
Press q to quit ↑←↓→ to move wasd to page t to toggle types g to jump
As you can see there is no need to navigate the Frame here.如您所见,无需在此处导航 Frame。 Is there a way to stop doing this for all python datatable Frames?有没有办法停止对所有 python 数据表框架执行此操作?
Thanks!谢谢!
As of 4/10/19, the latest version in github turns off the interactivity by default.截至 2019 年 4 月 10 日,github 中的最新版本默认关闭交互。 Before 0.9.0 release we'd have to compile it from source to get it.在 0.9.0 版本之前,我们必须从源代码编译它才能得到它。
In the current dev version, and in future datatable 0.9+ the display will be non-interactive by default.在当前的开发版本中,以及在未来的数据表 0.9+ 中,默认情况下显示将是非交互式的。 This behavior can be controlled via option dt.options.display.interactive = True|False
.这种行为可以通过选项dt.options.display.interactive = True|False
来控制。
In datatable 0.8 and younger, there are 2 ways to prevent the interactive prompt when displaying a Frame:在数据表 0.8 及以下版本中,有两种方法可以防止显示 Frame 时出现交互提示:
either using Frame.view(False)
:要么使用Frame.view(False)
:
In [1]: import datatable as dt In [2]: DT = dt.Frame(A=range(5)) In [3]: DT.view(False) A --- -- 0 0 1 1 2 2 3 3 4 4 [5 rows x 1 column] In [4]:
or change the default behavior via或通过更改默认行为
In [4]: dt.Frame.view.__defaults__ = (False,) In [5]: DT A --- -- 0 0 1 1 2 2 3 3 4 4 [5 rows x 1 column]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.