【问题标题】:Too much data given by "InteractiveShell.ast_node_interactivity" - Jupyter notebook“InteractiveShell.ast_node_interactivity”给出的数据太多 - Jupyter notebook
【发布时间】:2020-01-25 08:20:46
【问题描述】:

我希望一个单元格的输出很少。为此我使用:

from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"

代码运行良好,但它给了我一些不需要的数据。

Out[1]: <Figure size 2500x800 with 0 Axes>
Out[1]: <matplotlib.axes._subplots.AxesSubplot at 0x1a22e8ca50>
Out[1]: Text(0.5, 1.0, 'Przetrwanie, (0 = Zmarli / 1 = Ocaleni)')
Out[1]: [Text(0, 0.5, 'Liczba')]

我可以使用一些标志选项,例如:'all', '最后的', 'last_expr', '没有任何', 'last_expr_or_assign'

但没有一个选项可以解决问题:/

有什么想法吗??

【问题讨论】:

    标签: python python-3.x jupyter-notebook ipython jupyter


    【解决方案1】:

    根据documentation,“last_expr”`表示只输出最后一个表达式。您还可以参考https://towardsdatascience.com 中的漂亮article 了解更多详情。

    如果选项 InteractiveShell.ast_node_interactivity = "last_expr" 在您的情况下不起作用,请提供更多详细信息。

    【讨论】:

    • 这应该是一条评论。
    • @DavidLee 现在看起来像答案吗?如果没有,我会移到评论区。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-25
    • 1970-01-01
    • 1970-01-01
    • 2019-12-25
    • 1970-01-01
    相关资源
    最近更新 更多