I am trying to copy cells from one jupyter notebook to another. How this is possible?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
This feature has been introduced in Jupyter Notebook 5.0. Use
pip install notebook --upgrade
to upgrade to the latest release.Note that the old shortcuts
C
,V
andX
work only for copying and pasting inside one notebook. In order to do it across tabs, you should useCtrl-C
andCtrl-V
(Cmd-C
andCmd-V
on Mac).I have not done it myself though, but general practice is to avoid doing it as it can disturb the Cell JSON. It was not even possible until a few versions before. Recent Github posts has made it possible to do so though. Copy paste the cell in question to a code editor such as Atom or Sublime Text, make the changes you want to do and then paste it into the new Jupyter notebook. It should work.
With jupyter 5.0.0, copy paste of one or many cells from one notebook to another works with Cmd C Cmd V (Mac).
For copying many cells together, select the first one then the last one with shift arrow (up or down).
The tool bar does not work for this purpose.
See also https://github.com/jupyter/notebook/issues/2336
For windows-
Use
Ctrl + Shift + C
to copy cells after selecting them usingshift + arrow
keys.Then, switch to the notebook to which you want to copy the selected cells and go to command mode in it by pressing
Esc
key. Then, useCtrl + Shift + V
to paste the cells in that notebook.Note- I have not tested this on Linux but should work just as the procedure above.
You can download the cell content as .py file from jupier and then you can copy and paste wherever you want