Jupyter Magic Memory

  1. %: line magic, %%cell magic
  2. Repeat Command:
    %recall
  3. Write cell content into a file:
    %%writefile file.py
  4. To autoreload your pyfile:
    %load_ext autoreload
    %autoreload 2
    from yourfile import yourFunction
    https://ipython.org/ipython-doc/3/config/extensions/autoreload.html
  5. Use R in jupyter
    %load_ext rpy2.ipythonR magic in cell
    %%Rcode in line
    %R

    Move variable between R and python
    %Rpush, %Rpull
    R magic tutorial: https://blog.dominodatalab.com/lesser-known-ways-of-using-notebooks/
    R magic: https://ipython.org/ipython-doc/2/config/extensions/rmagic.html
    rpy2: http://rpy2.readthedocs.io/en/version_2.8.x/index.html
    Problem in rmagic: https://stackoverflow.com/questions/25829963/r-magic-for-ipython-notebook-runtime-error-turning-off-device-on-new-server-inst

  6. %store
    store variable between different ipython notebook

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.