Jupyter notebook中的Cell and Line Magics

  Reference materials:

  https://www.jianshu.com/p/81ada9234788

  https://my.oschina.net/u/2306127/blog/832510

  First of all, what is Cell and Line Magics? The most common ones are% matplotlib inline and %% time, the function should be clear to everyone. The former is to control drawing directly in the Jupyter console, while the latter can conveniently record the running time of a cell, and the pwd and ls that I often run directly in the notebook. But until today I didn't know the names of these wonderful features: magic ~: cell magic and line magic, the former will act on a single line, and the latter will act on a single cell. As we all know, the unique advantage of notebook is that it is extremely convenient to debug, and the ability to flexibly use these magics will definitely do more with less.

  I found a very good website, which is very convenient to check all magics, and found that there has been a mistake. Magics is actually a feature of IPython, and Jupyter notebook is actually based on IPython kernel.

  Not too long-winded, if you want to know more about these magical magics, just click the link below ~

  https://ipython.readthedocs.io/en/stable/interactive/magics.html#cell-magics

Guess you like

Origin www.cnblogs.com/chester-cs/p/12673134.html