zipzit
zipzit

Reputation: 3997

Project Juypter In / Out Bracket Notation

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?

Upvotes: 1

Views: 5188

Answers (1)

DSM
DSM

Reputation: 353059

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.

Upvotes: 4

Related Questions