notebook.rst 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. .. _notebook:
  2. Notebooks
  3. =========
  4. Jupyter notebooks are documents that combine live runnable code with
  5. narrative text (Markdown), equations (LaTeX), images, interactive
  6. visualizations and other rich output:
  7. .. image:: images/notebook/notebook_ui.png
  8. :align: center
  9. :class: jp-screenshot
  10. **Jupyter notebooks (.ipynb files) are fully supported in JupyterLab.** The
  11. `notebook document format <https://nbformat.readthedocs.io/en/latest/>`__ used in
  12. JupyterLab is the same as in the classic Jupyter Notebook. Your existing notebooks
  13. should open correctly in JupyterLab. If they don’t, please open an issue on our
  14. `GitHub issues <https://github.com/jupyterlab/jupyterlab/issues>`__ page.
  15. .. _create-notebook:
  16. Create a notebook by clicking the ``+`` button in the file browser and
  17. then selecting a kernel in the new Launcher tab:
  18. .. raw:: html
  19. <div class="jp-youtube-video">
  20. <iframe src="https://www.youtube-nocookie.com/embed/QL0IxDAOEc0?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  21. </div>
  22. .. _rename-file:
  23. A new file is created with a default name. Rename a file by
  24. right-clicking on its name in the file browser and selecting “Rename”
  25. from the context menu:
  26. .. raw:: html
  27. <div class="jp-youtube-video">
  28. <iframe src="https://www.youtube-nocookie.com/embed/y3xzXelypjs?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  29. </div>
  30. The user interface for notebooks in JupyterLab closely follows that of
  31. the classic Jupyter Notebook. The keyboard shortcuts of the classic
  32. Notebook continue to work (with command and edit mode). However, a
  33. number of new things are possible with notebooks in JupyterLab.
  34. .. _drag-drop:
  35. Drag and drop cells to rearrange your notebook:
  36. .. raw:: html
  37. <div class="jp-youtube-video">
  38. <iframe src="https://www.youtube-nocookie.com/embed/J9xoTGdqWIo?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  39. </div>
  40. .. _drag-copy:
  41. Drag cells between notebooks to quickly copy content:
  42. .. raw:: html
  43. <div class="jp-youtube-video">
  44. <iframe src="https://www.youtube-nocookie.com/embed/YTNZ5TS2LfU?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  45. </div>
  46. .. _multiple-views:
  47. Create multiple synchronized views of a single notebook:
  48. .. raw:: html
  49. <div class="jp-youtube-video">
  50. <iframe src="https://www.youtube-nocookie.com/embed/SQn9aRc050w?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  51. </div>
  52. .. _collapse-code:
  53. Collapse and expand code and output using the View menu or the blue
  54. collapser button on left of each cell:
  55. .. raw:: html
  56. <div class="jp-youtube-video">
  57. <iframe src="https://www.youtube-nocookie.com/embed/WgiX3ZRaTiY?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  58. </div>
  59. .. _enable-scrolling:
  60. Enable scrolling for long outputs by right-clicking on a cell and
  61. selecting “Enable Scrolling for Outputs”:
  62. .. raw:: html
  63. <div class="jp-youtube-video">
  64. <iframe src="https://www.youtube-nocookie.com/embed/U4usAUZCv_c?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  65. </div>
  66. .. _cell-output-mirror:
  67. Create a new synchronized view of a cell’s output:
  68. .. raw:: html
  69. <div class="jp-youtube-video">
  70. <iframe src="https://www.youtube-nocookie.com/embed/Asa_ML45HP8?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  71. </div>
  72. .. _tab-completion:
  73. Tab completion (activated with the ``Tab`` key) can now include additional
  74. information about the types of the matched items:
  75. .. raw:: html
  76. <div class="jp-youtube-video">
  77. <iframe src="https://www.youtube-nocookie.com/embed/MuNr0i8LgpM?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  78. </div>
  79. Note: IPython 6.3.1 has temporarily disabled type annotations.
  80. To re-enable them, add ``c.Completer.use_jedi = True`` to an
  81. `ipython_config.py <https://ipython.readthedocs.io/en/stable/development/config.html>`__ file.
  82. .. _tooltip:
  83. The tooltip (activated with ``Shift Tab``) contains additional
  84. information about objects:
  85. .. raw:: html
  86. <div class="jp-youtube-video">
  87. <iframe src="https://www.youtube-nocookie.com/embed/TgqMK1SG7XI?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  88. </div>
  89. .. _create-console:
  90. You can connect a :ref:`code console <code-console>` to a notebook kernel to have a log of
  91. computations done in the kernel, in the order in which they were done.
  92. The attached code console also provides a place to interactively inspect
  93. kernel state without changing the notebook. Right-click on a notebook
  94. and select “New Console for Notebook”:
  95. .. raw:: html
  96. <div class="jp-youtube-video">
  97. <iframe src="https://www.youtube-nocookie.com/embed/eq1l7DBngQQ?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  98. </div>
  99. .. _cell-toolbar:
  100. If there is enough room for it, each cell has a toolbar that provides quick access to
  101. commonly-used functions. If you would like to disable the cell toolbar, run
  102. ``jupyter labextension disable @jupyterlab/cell-toolbar-extension`` on the command line.
  103. You can enable it again by running
  104. ``jupyter labextension enable @jupyterlab/cell-toolbar-extension``.