I have seen that a lot of people write code in ipython notebook when doing statistical analysis on data, apart from easy visualization after each step rather than running the whole code every time on a .py file. What are the other advantages,if there are any?

Also in industry which one is used more often?

  • 3
    $\begingroup$ Not an advantage really, but as of 2019, all Python IDEs for scientific/numeric computing in interactive mode suck, with ipython/jupyter still being the least worst one. $\endgroup$ – anymous.asker Jan 19 '19 at 11:48
  • $\begingroup$ I can confirm that industry uses both, based on my own experience in 2 totally different domains; everyone uses jupyter notebooks for fast prototyping of ideas, whereas you convert them to python scripts when time for industrial deployment comes $\endgroup$ – pcko1 Jan 19 '19 at 15:16

iPython notebooks are great for some cases. I use them because of:

  • Easy in-place editing and immediate execution, very friendly for quick and experimental stuff
  • In-place visualization. Also, ability to have multiple figures on the same page, compare them, re-run figures, move the cells. Much more convenient than multiple and independent OpenCV's imshow windows.
  • They are more convenient for step-by-step iterative analysis
  • Since they are collection of code blocks prepended with a description and followed with the results, they are great for tutorials and guides.

You can compare the notebooks to test stands, where you can quickly assemble something working to demonstrate to the others, while Python modules are more like building blocks to be used either for demonstration or for production later. Thus, combination of both is very powerful.

  • 1
    $\begingroup$ Ipython notebook or jupyter notebook provides functionality to contain both code and rich text elements, such as figures, links, equations. Since,we can mix code and text elements, these documents are the ideal place to bring together an analysis description, and its results, as well as, they can be executed perform the data analysis in real time. $\endgroup$ – AB Abhi Jan 20 '19 at 6:28

Using iPython provides many advantages. Just two of them are here according to me:

  • We run codes step by step, so we don't have to start from the first line. We change only wrong line or error lines easily.
  • I feel like taking notes on notebook, not only writing code.

Also Nature published an article about interactive notebook books like iPython in 2014 which is Interactive notebooks: Sharing the code. It mentions about story of iPython, motivation and causes of developing it. To understand the main idea of iPython you can read it.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.