【问题标题】:Output order in Jupyter notebookJupyter笔记本中的输出顺序
【发布时间】:2021-09-13 10:00:13
【问题描述】:

我试图在 Google colab 的 jupyter notebook 中运行以下代码,但打印函数的结果出现在图形可视化之前,尽管可视化在代码中出现得更早。有人可以向我解释为什么会发生这种情况,而 Jupyter 没有在代码中显示结果吗?

num_nodes = 4
G = nx.DiGraph(nx.path_graph(num_nodes))
nx.draw(G, with_labels = True)

pr = nx.pagerank(G, alpha=0.8)
print(pr)

【问题讨论】:

    标签: python-3.x jupyter-notebook


    【解决方案1】:

    不。 Jupyter 不会显示代码中的结果。 最好使用图表内的文本或在另一个代码块中运行

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-01
      • 2020-06-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多