How can I copy multiple cells from one notebook to another at once (the cells should not merge after pasting)

Viewed 5956

How can I copy multiple cells from one jupyter notebook to another notebook at once, and the cells will not merge after pasting?

I have tried this solution, in which shift+Up/Down are used for selection, cmd⌘+c and cmd⌘+v are used for copying and pasting. However, the cells will merge after pasting.

Is there a way to prevent the cells from merging?

2 Answers

Thanks for the tips. I tried and found the way not to merge:

  1. Press esc key (command mode, the area will turn to blue), 2) use shift+up/down to choose(all turn to blue area) 3) cmd⌘+c to copy
  2. Another notebook( you will paste), also press esc key first( that's how not merge) and cmd⌘+v to paste the multi cells, you will get multi cells, including outputs.

The cells do not seem to merge, using Jupyter Lab version 2.1.5.

  • Click on the left of the top cell you'd like to copy.
  • Press the Shift key and click on the bottom cell you'd like to copy.
  • The sequence of cells should be highlighted now (in light blue with the usual theme)
  • Press the C key to copy
  • Select the cell above the cell you want the new cells to appear.
  • Press the V key to paste

Result (note that the new cells will have numbers matching the old ones):

enter image description here

Related