jameslee5656
jameslee5656

Reputation: 211

Move the cell in jupyter notebook up and down

I have a cell (cell 39), I wish to move up to the top of cell 40. I know I could grab and drag to the place. However, I see that in official document, you could move it with the vertical bar on the left. However, I does not have one, and could not find the setting to make it display.

Demonstration in Visual Code.

Jupyter Notebook in chrome version has a similar botton for this function Jupyter Notebook web version.

Upvotes: 21

Views: 20234

Answers (2)

user3503711
user3503711

Reputation: 2056

Somehow, keyboard shortcut (Alt+Arrow) didn't work for me. I dragged it with the Mouse pointer.

On the left side, beside the play button, click the grey bar, which will turn into Blue. Then drag it with you mouse wherever you want to place it. Or you directly click the grey bar and drag it. (Shown in the GIF)

enter image description here

Upvotes: 2

Fredrik Erlandsson
Fredrik Erlandsson

Reputation: 1527

According to https://github.com/microsoft/vscode-jupyter/issues/6812 you can use alt(option)+arrow up/down to move the selected cell.

Or, use Command Palette with Notebook: Move

https://user-images.githubusercontent.com/30305945/127107696-af3caf2a-1757-44d0-a619-ae4e82c03037.png

Upvotes: 33

Related Questions