Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Jupyter Cells

I am new to Jupyter. What is the purpose of dividing a notebook into different cells?

1 response

A couple of very useful reasons to separate a notebook into multiple cells (rather than simply all the code in one cell). In no particular order.

  • the values of variables are saved after a cell is run. Therefore, one can run a pipeline which may take several minutes, in one cell, but then use the results in subsequent cells without re-running the pipeline. A big timesaver.
  • comment using markup cells between code cells to make code more readable.
  • output such as graphs and dataframes are easier, and more legible, if there is just a single output per cell.