notebook.rst 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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 Notebook (.ipynb files) are fully supported in JupyterLab.**
  11. Furthermore, the `notebook document
  12. format <http://nbformat.readthedocs.io/en/latest/>`__ used in JupyterLab
  13. is the same as in the classic notebook. Your existing notebooks should
  14. open correctly in JupyterLab. If they don’t, please open an issue on our
  15. `GitHub issues <https://github.com/jupyterlab/jupyterlab/issues>`__
  16. page.
  17. Create a notebook by clicking the ``+`` button in the file browser and
  18. then selecting a kernel in the new Launcher tab:
  19. .. raw:: html
  20. <div class="jp-youtube-video">
  21. <iframe src="https://www.youtube-nocookie.com/embed/QL0IxDAOEc0?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  22. </div>
  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 and drop cells to rearrange your notebook:
  35. .. raw:: html
  36. <div class="jp-youtube-video">
  37. <iframe src="https://www.youtube-nocookie.com/embed/J9xoTGdqWIo?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  38. </div>
  39. Drag cells between notebooks to quickly copy content:
  40. .. raw:: html
  41. <div class="jp-youtube-video">
  42. <iframe src="https://www.youtube-nocookie.com/embed/YTNZ5TS2LfU?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  43. </div>
  44. Create multiple synchronized views of a single notebook:
  45. .. raw:: html
  46. <div class="jp-youtube-video">
  47. <iframe src="https://www.youtube-nocookie.com/embed/SQn9aRc050w?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  48. </div>
  49. Collapse and expand code and output using the View menu or the blue
  50. collapser button on left of each cell:
  51. .. raw:: html
  52. <div class="jp-youtube-video">
  53. <iframe src="https://www.youtube-nocookie.com/embed/WgiX3ZRaTiY?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  54. </div>
  55. Enable scrolling for long outputs by right-clicking on a cell and
  56. selecting “Enable Scrolling for Outputs”:
  57. .. raw:: html
  58. <div class="jp-youtube-video">
  59. <iframe src="https://www.youtube-nocookie.com/embed/U4usAUZCv_c?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  60. </div>
  61. Create a new synchronized view of a cell’s output:
  62. .. raw:: html
  63. <div class="jp-youtube-video">
  64. <iframe src="https://www.youtube-nocookie.com/embed/Asa_ML45HP8?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  65. </div>
  66. Tab completion (activated with the ``Tab`` key) now includes additional
  67. information about the types of the matched items:
  68. .. raw:: html
  69. <div class="jp-youtube-video">
  70. <iframe src="https://www.youtube-nocookie.com/embed/XXX NEED TODO?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  71. </div>
  72. The tooltip (activated with ``Shift Tab``) contains additional
  73. information about objects:
  74. .. raw:: html
  75. <div class="jp-youtube-video">
  76. <iframe src="https://www.youtube-nocookie.com/embed/TgqMK1SG7XI?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  77. </div>
  78. You can connect a :ref:`code console <code_console>` to a notebook kernel to have a log of
  79. computations done in the kernel, in the order in which they were done.
  80. The attached code console also provides a place to interactively inspect
  81. kernel state without changing the notebook. Right-click on a notebook
  82. and select “Create Console for Notebook”:
  83. .. raw:: html
  84. <div class="jp-youtube-video">
  85. <iframe src="https://www.youtube-nocookie.com/embed/eq1l7DBngQQ?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  86. </div>