My favorite Jupyter notebook shortcuts
Вставка
- Опубліковано 14 жов 2024
- Do you use Jupyter a lot? I sure do, and I've gotten pretty good at doing so, thanks to a bunch of shortcuts that it provides. In this video, I show you my favorite shortcuts -- the ones that let me live-code quickly when I'm teaching, and just navigate around my notebooks easily when I'm experimenting with Python code on my own.
For free, weekly Python tips, join my "Better developers" newsletter: BetterDevelope...
Thanks. You have been so much helpful. I was tired of continuously shifting from code to markdown and vice versa
You can use the numbers 1, 2,3 which creates a header with cell as markdown. I use this all the time ;-)
Great content, thank you for making this video. I've been using Jupyter notebook for a few week and have watched plenty of videos, but this is the first time I have heard of command mode. Once again, great content and presentation.
Thank you so much this video! I'm newbie with jupyter and I was using the mouse to make new cells or run the code. This shortchuts will be really helpful to make me more productive
Great to hear -- thanks for letting me know!
This is gold! Thank you for the Enter "trick"!!!
Delighted to know you enjoyed it!
Watched the video on 2X speed. very informative. Thanks!
Yes Very Useful 100% satisfied as I didn't knew this is like tresure😍🎵
It doesn't show any keyboard shortcuts list in Jupyter notebook when I press . Quite strange.
Hmm... you have to be in command mode. Make sure to press ESC first. Otherwise... I dunno!
great video....thank you....
Great stuff! To Split cells in Windows place the cursor where you want the split and then ctrl shift minus.
cursor must be at the beginning of the line
Wow what a great video, Crisp and to the point.
Happy to hear you liked it!
Thank you sir. This video was very helpful for me.
Great to hear!
You blow my mind!!! Amazing!!!
Happy to hear you enjoyed it!
learned something new today..thanks for posting..
Glad to hear it!
As expected that is a very useful video.
Thanks
Thank you soo much !
Glad it helped!
this is an AMAZING video !! thank you soo much, so helpful and clear
I'm delighted you enjoyed it!
Great and very useful information....
But sir I want to Know also how your typing speed is so much fast .I am beginner and my typing speed is so low.
I've gotten another request to talk about my typing speed -- so I'll make a video about that soon!
It is indeed a very helpful video, thanks for uploading it!
Very useful,thanks
Thank you so much for this video! 😇
You are so welcome!
why does this video not have 10MM views?
Awsm vedio! Just tell me if my cursor is between " " and I want jump out of it without using my right arrow key. How will I do that what is the shortcut key...??
I sometimes press ESC then ENTER, just to see where my cursor is. Hope this helps, and glad you enjoyed the video!
@@ReuvenLerner I know where my cursor is but my question is how I will jump out of any symbols like " " or ("Hello") I don'
t want to use my right arrow.
@@ramanverma3166 Ah, I'm not sure. You could try the Emacs-style keys, such as control-e to go to the end of the line. But I'm not sure on which systems those will work.
Thank you so much 😇
amazing video, thank you!
I'm glad you enjoyed!
Terrific video! In command mode, is there a way to copy multiple non-adjacent coding cells and paste them?
In theory, you can use some combination of control and/or alt with copying to get multiple, non-consecutive cells. But I've have very mixed experience with it. Maybe there's a clear formula for making it work, and I simply haven't figure that out yet.
For some reason, the last trick, 'f' find+replace is not working for me. I am not getting the dialogue box
Some shortcuts have definitely changed in the last few years, especially with the introduction of Notebook 7. Command-F to find still works, but search-and-replace doesn't seem to, at least from what I can tell. (I don't use it *that* much, so I haven't missed it, I guess!)
Nice Explanation Dear sir....
Very helpful, thank you! Do you if there's a whole to comment out a whole block in jupyter? I've been trying to google it but no luck, I've seen instructors do it before though.
You can comment/uncomment Python code with control-/ (slash). Just highlight the text you want to comment, and hit that key combination.
@@ReuvenLerner thank you so much
very useful, thanks you so much!
Glad you enjoyed it!
That was very useful sir
Great Great Video Buddy. Super Handy.
Glad it helped!
good job sir
Thanks for the kind words!
Great video and awesome explanations!
This seems helpful. Unfortunately shortcuts aren't working in my notebook. I swear I'm cursed. Every damn thing I do in Python requires troubleshooting.
Oh, no! I'm sorry to hear that you're having these problems. It definitely takes time to get your environment working in a way that makes sense and is stable.
What’s the easiest way to get brackets () without pressing shiftttt then bracket button?
Jupyter can't help you there, I'm afraid -- try remapping your keyboard, or getting one with dedicated () keys.
Hi, I wanted to know what my professor may mean when he is referring to "a block" in Jupyter, thanks and loved the video!
"Blocks" in Python are parts of the code that are indented together, and which come after a colon. So after an "if" statement, you'll have a block. Or a "for" loop is defined in a block.
However, your professor might be using the term "block" to refer to Jupyter's cells, into which you can type.
I hope this helps!
great , liked it !
Glad to hear it!
TYSM for these tips....really helped a lottttttt...
Excellent!
nothing, nobody made me to subscribe anyone so quick.
Delighted to hear it!
Thanks.That's very useful
thanks a lot
How to retrieve the icons on notebook?i change themes by using jt -1 orders
What icons do you want to retrieve?
Question. CTRL SHIFT - (CTRL _) seems to break sometimes and stop splitting cells. Do you know why that might be? I thought I was in bizzarro world until you confirmed that is the split command. I went back to J notebook and it worked. Now it has stopped working again.
Sorry, I don't know! Maybe you are somehow accidentally getting into edit mode, rather than command mode?
Note that for this you need to be in EDIT mode and not Command Mode. See the outline in the video. it is green.
Thanks. I will pay attention for that
How can i make multiple cells in jupiter notebook to put multiple inputs?
You can have as much (or as little) Python code as you want in each cell. So you can call the "input" function multiple times, thus getting several, distinct inputs from the user. Presumably, you would then want to assign those inputs to separate variables, which you could use later on.
Excellent 👍
Glad it helped!
how to get signatures or how to know what values have to go into the function.
Type annotations are a great, important, and useful tool... but they aren't used much in Jupyter notebooks, so far as I know.
Thanks you, very helpfull !
Is there a shortcut for the help function.
Yes! Enter 'h' in command mode.
Need to remember that a and b is for above and below, not by after and before.
Legend 🙌🏻
Hi, in my windows 10 control-_ underscore didn't work. to split the codes into different lines.
The shortcut keys are a bit different on each platform. What you can do is press "h" in command mode, and thus see the keys you need for different functionality on Windows. I'm not sure what you should be using, but there's almost certainly something!
@@ReuvenLerner will do thanks. Also I wanted to know I have a code of few lines and for time being I want to make all into comments (#) is there any shortcut?
Helpful...thanku
Thanks
Everyone keeps talking about command mode. What exactly is it and how do we access it to use the shortcuts?
You can use ESC (or click on the left side) to get into command mode. Press H to see all of the commands that are available in command mode.
can we run single line code in jupyter notebook
Sure! You can enter as many (or as few) lines as you want in a cell, and then run them.
@@ReuvenLerner Thank you so much
thank you so much
After pressing Shift +Enter a new cell is created but that shows two cursors, one in the previous cell and the other in the current one. I'm not able to write the code in the new cell. Please help
Hmm, it could be a few things.
(1) Maybe the cell isn't a code cell any more, but is a Markdown/Raw cell? Check the cell type. If it's a code cell, you'll see "In []" on the left.
(2) Maybe Jupyter is stuck? If you see "In [*]" on the left, use Kernel->interrupt to kick the kernel a bit.
how to able toggle toolbar after disabling it , its not showing when i click on toggle toolbar option again
I'm not sure what to suggest; the tool bar should become visible when you choose the menu option to toggle it on and off.
How to delete a selected Cell?
I tried "cmd + D, D" but it doesn't works
First, you have to be in command mode. Either press ESC or click to the left of the cell.
Once you've done that, you can use "x" to cut it.
Double D key
i AM using jupyter notebook ....when i run a cell using SHIFT + ENTER . cursor doesn't go Automatically to next cell .. i have to manually put cursor in next cell ...... how it would go automatically in next cell...??
On my computer (a Mac), shift+enter runs + creates a new cell, selecting it. But command+Enter runs without creating a new cell. Maybe your computer (or its keyboard) should be using a different modifier key?
You can try Alt + Enter
Hello I mistakenly deleted complete file how can I restore it
Depends on how you deleted it... but if you don't have any backups and it's not in the trash bin on your computer, then I'm afraid that it's almost certainly gone.
Amazing👍
How to delete full folders without having to go through all of the subfolders and empty them before deleting the main folder??
I don't think that there is a Jupyter command to do that. You would have to do that in your OS (or via a ! command in Jupyter). In Unix, you could say "rm -r DIRNAME", but be warned! That's potentially quite dangerous. I usually prefer to move everything to /tmp, just in case with "mv -v * /tmp". Then, if I make a mistake, I can undo it.
@@ReuvenLerner I m using windows...
I actually have another problem don t know why is that when I use PATH = os.path.join('MP_DATA'). I was able to create a new folder and now it doesn't work. I can't understand!?
@@imanefahim8557 This isn't a good place for me to explain os.path.join and other such things. (I'm hoping to create some videos on the "os" package anyway, so this gives me a good push!) But it's hard for me to know what you got wrong from your description - what error message you got, what you were entering, if it was in Jupyter vs. the command line, etc. There are lots of little things to notice and take care of. But it is possible, I promise!
@@ReuvenLerner yeah I understand, I solve it actually. Thanks 😊
@@ReuvenLerner Do you have a video explaining how to move your project from Jupyter notebook to local python?
how to increase or decrease text size
Jupyter runs in the browser. So you can use your standard browser mechanism for increasing text size. I use Firefox on a Mac, so I use command-plus and command-minus.
Wowo
Great tutorial ... for lazy people! 😉
Glad it helped!
Thanks