IPython Notebook Recommendations

I would like to summarize the charm of IPython Notebook, which is hot in me recently. It should be okay if you follow the official description for installation and easy usage, so if you are interested, please refer to that and install and use it.

This entry is written for those who have never used IPython Notebook or who have used it for a while but do not know what to do, and refer to other people's articles and official documents for specific usage. Please try.

What can I do with IPython Notebook?

IPython Notebook is a web-based interactive computing environment. On the Notebook, you can use the code and its execution results, text cells that are html rendered in Markdown notation and you can insert formulas in LaTeX notation, and rich features such as plots and other images and videos, embedding external sites.

From the completed notebook, it can be converted to other formats and output, and it can be converted to HTML, PDF, rst format or Python executable file (.py). If you convert it to rst, you can convert it to TeX with Sphinx etc., so it will be possible to make a paper as it is compiled with IPython Notebook.

There is also a slideshow function using Reveal.js, and if you use the extension function live_reveal, you can demonstrate the code on the slide on the spot. You can use it like this. I've touched on this briefly before, so I'll link to it (IPython 3.0.0-dev, "LIVE" HTML presentation in IPython Notebook )). It says that it can only be used with the dev-3.0 version, but thanks to the efforts of the creator of live_reveal, it can also be used with ver2.3 (stable).

Furthermore, if you put the created Notebook in the public repository of GitHub, anyone can see the converted version of the file from the site called nbviewer. It's written by others, making it easier to study and a great tool for sharing knowledge.

reference:

The good thing about IPython Notebook

As you can see by reading the sites listed above, I would like to write a few points that I have used and found to be better than using a text editor or integrated environment.

You can leave the process of trial and error

Rather than using an interactive shell or creating a lot of small prototype files, the results can be displayed in the same place, so I think it's easier to compare different methods.

Trial and error is easy

Since the program can be executed in small units called cells, bugs can be reduced with less effort if devised. Also, although it is small and easy, up to about 100 lines including line breaks and comments can be displayed in one cell in an easy-to-read manner, and I think the concept of this cell is an exquisite point.

Markdown + LaTeX = Best Document Creation Environment

I think it's also great as a markdown text editor (or rather, I'm writing it in ipynb now). Since it is divided into small units called cells, you can rearrange them freely and editing is easy. I personally use it as a research notebook. Also, as it was born from the SciPy project, LaTeX notation is natively supported. It's not as stiff as TeX and can be viewed as a clean formula on the fly, so you'll notice mistakes faster and you won't have to be buried in a pile of error messages. I think it can also be used as a draft of LaTeX (it will be useful in the thesis).

Shortcut is Vim-like

Keyboard shortcuts are Vim-like and easy to use. To edit a cell, press Enter to enter edit mode and Esc to exit. You can move between cells with j and k, so you don't have to touch the mouse so much, so I think it's an environment where you can concentrate on the content. Of course, you can change the key bindings for shortcuts.

Easy and cool to share results

Not only the comment of the code but also the explanation of the algorithm can be written in detail in markdown notation, so it is most convenient when explaining while showing it to people. Not only the result but also the code will be shown properly, so you will be able to share detailed know-how. It also has a slide show function, so you can explain it in front of more people. Then, as I mentioned at the beginning, you can share it with nbviewer even if you don't have an IPython Notebook environment.

(Actually) other languages can be used

In addition to Python, you can mix and use Bash, Julia, a popular language that is being developed recently, Haskell, a functional language, Ruby, a scripting language, and Perl, R, and Cython code. Taking advantage of parallel processing, it can be used as a platform, and it can be shared with documents!

Recently, it seems that development under the new name "Jupyter" is being actively carried out, partly because the name "Python" is still being given due to the support of multiple languages as described above. (In dev-3.0, it starts up as Jupyter instead of IPython notebook on the browser, and the nbviewer mentioned earlier is also labeled as Jupyter's shared environment)

A little more about IPython Notebook

I've mentioned a lot of good points, but it's still not easy to use, and I think it's difficult to use, so I'll mention a little. I would like to know if there is a good solution.

Memory eating

Rather than developing only with a text editor such as Vim, the server is started and the browser is started and operated, so the CPU usage rate and memory usage rate are high. Well, this may be unavoidable.

Not a good slide show environment

I wrote that it can also be used as a slide show, but it is not as intuitive as PowerPoint or KeyNote, so you may not expect a perfect slide. Also, there are only a limited number of options for adjusting the appearance. You can apply the default theme of reveal.js, but there are about 6 types and about 4 transition animations. It's written in JavaScript, so if you can write it yourself, that's fine, but I can't do it myself, so I'd like to do something better. The more pervasive it is, the more sophisticated the management and types of themes may be, making it easier to use.

Summary

I didn't really touch on how to use it in this entry, but it's something you'll get used to while using it, and I think it's best to check it each time. As I mentioned as a good point, I think it is wonderful to be able to easily share the details of analysis, and I hope that if this flow becomes mainstream, the speed and efficiency of research will be much faster. I am.

Recommended Posts

IPython Notebook Recommendations
ipython notebook installation
Remotely connect IPython notebook
[IPython] How to Share IPython Notebook
Parallel computing with iPython notebook
Displaying strings on IPython Notebook
How to use IPython Notebook
Play with Jupyter Notebook (IPython Notebook)
Launch the IPython notebook server
Run Apache-Spark with IPython Notebook
Run IPython Notebook on Docker
Graph drawing with IPython Notebook
Use Bokeh with IPython Notebook
R & D life with iPython notebook
Build IPython Notebook environment with boot2docker
Batch processing notes in IPython Notebook
IPython Notebook is now rendered on GitHub!
Use apache Spark with jupyter notebook (IPython notebook)
"LIVE" HTML presentation with IPython 3.0.0-dev, IPython Notebook
Rich cell output with Jupyter Notebook (IPython)
How to revive cells in iPython notebook
How to debug with Jupyter or iPython Notebook
Launch and use IPython notebook on the network
Use emacs or vim keybindings in IPython notebook
Graph drawing with jupyter (ipython notebook) + matplotlib + vagrant
Introducing Spark to EC2 and linking iPython Notebook
Create a table of contents with IPython notebook