notebook.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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 <http://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 a notebook by clicking the ``+`` button in the file browser and
  16. then selecting a kernel in the new Launcher tab:
  17. .. raw:: html
  18. <div class="jp-youtube-video">
  19. <iframe src="https://www.youtube-nocookie.com/embed/QL0IxDAOEc0?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  20. </div>
  21. A new file is created with a default name. Rename a file by
  22. right-clicking on its name in the file browser and selecting “Rename”
  23. from the context menu:
  24. .. raw:: html
  25. <div class="jp-youtube-video">
  26. <iframe src="https://www.youtube-nocookie.com/embed/y3xzXelypjs?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  27. </div>
  28. The user interface for notebooks in JupyterLab closely follows that of
  29. the classic Jupyter Notebook. The keyboard shortcuts of the classic
  30. Notebook continue to work (with command and edit mode). However, a
  31. number of new things are possible with notebooks in JupyterLab.
  32. Drag and drop cells to rearrange your notebook:
  33. .. raw:: html
  34. <div class="jp-youtube-video">
  35. <iframe src="https://www.youtube-nocookie.com/embed/J9xoTGdqWIo?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  36. </div>
  37. Drag cells between notebooks to quickly copy content:
  38. .. raw:: html
  39. <div class="jp-youtube-video">
  40. <iframe src="https://www.youtube-nocookie.com/embed/YTNZ5TS2LfU?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  41. </div>
  42. Create multiple synchronized views of a single notebook:
  43. .. raw:: html
  44. <div class="jp-youtube-video">
  45. <iframe src="https://www.youtube-nocookie.com/embed/SQn9aRc050w?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  46. </div>
  47. Collapse and expand code and output using the View menu or the blue
  48. collapser button on left of each cell:
  49. .. raw:: html
  50. <div class="jp-youtube-video">
  51. <iframe src="https://www.youtube-nocookie.com/embed/WgiX3ZRaTiY?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  52. </div>
  53. Enable scrolling for long outputs by right-clicking on a cell and
  54. selecting “Enable Scrolling for Outputs”:
  55. .. raw:: html
  56. <div class="jp-youtube-video">
  57. <iframe src="https://www.youtube-nocookie.com/embed/U4usAUZCv_c?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  58. </div>
  59. Create a new synchronized view of a cell’s output:
  60. .. raw:: html
  61. <div class="jp-youtube-video">
  62. <iframe src="https://www.youtube-nocookie.com/embed/Asa_ML45HP8?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  63. </div>
  64. Tab completion (activated with the ``Tab`` key) now includes additional
  65. information about the types of the matched items:
  66. .. todo:: Make a screencast video of this?
  67. The tooltip (activated with ``Shift Tab``) contains additional
  68. information about objects:
  69. .. raw:: html
  70. <div class="jp-youtube-video">
  71. <iframe src="https://www.youtube-nocookie.com/embed/TgqMK1SG7XI?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  72. </div>
  73. You can connect a :ref:`code console <code_console>` to a notebook kernel to have a log of
  74. computations done in the kernel, in the order in which they were done.
  75. The attached code console also provides a place to interactively inspect
  76. kernel state without changing the notebook. Right-click on a notebook
  77. and select “Create Console for Notebook”:
  78. .. raw:: html
  79. <div class="jp-youtube-video">
  80. <iframe src="https://www.youtube-nocookie.com/embed/eq1l7DBngQQ?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  81. </div>