Project Juypter In / Out Bracket Notation

允我心安 提交于 2020-04-07 06:48:30

问题


I'm trying to learn how project Juypter works (formerly IPython Notebook) I've very confused by the cell identifier's In[] and Out[] I understand In = an input cell and Out = an output cell, but I'm baffled by the significance of the number within the brackets. What does that signify? It seem very prominent in the output, and I'm really baffled why I can't find any documentation on what that represents, and why it's there. I've been searching for the past hour.

Search terms: "ipython notebook in out bracket notation indexes" and variations combinations of those words. I've been thru numerous tutorials as well as the documentation at: http://jupyter-notebook.readthedocs.org/en/latest/ and at http://jupyter.readthedocs.org/en/latest/index.html . I'm drawing a total blank.

What does the cell notation In[7] and Out[7] signify. Why are those numbers there?


回答1:


The numbers after In and Out are the execution counts associated with the cells: the first cell executed gets 1, the second 2, and so on:

Execution counter (prompt number)

The kernel should have a single, monotonically increasing counter of all execution requests that are made with store_history=True. This counter is used to populate the In[n] and Out[n] prompts. The value of this counter will be returned as the execution_count field of all execute_reply and execute_input messages.



来源:https://stackoverflow.com/questions/36022605/project-juypter-in-out-bracket-notation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!