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...

КОМЕНТАРІ • 125

  • @saumyashah6622
    @saumyashah6622 3 роки тому +5

    Thanks. You have been so much helpful. I was tired of continuously shifting from code to markdown and vice versa

  • @KauleisteClever
    @KauleisteClever 3 роки тому +4

    You can use the numbers 1, 2,3 which creates a header with cell as markdown. I use this all the time ;-)

  • @russnagel1
    @russnagel1 3 роки тому +1

    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.

  • @watheusbr
    @watheusbr 2 роки тому +1

    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

    • @ReuvenLerner
      @ReuvenLerner  2 роки тому

      Great to hear -- thanks for letting me know!

  • @viniciussantos6728
    @viniciussantos6728 3 роки тому +1

    This is gold! Thank you for the Enter "trick"!!!

  • @safaaal-wajidi4606
    @safaaal-wajidi4606 3 роки тому +5

    Watched the video on 2X speed. very informative. Thanks!

  • @fuckindia
    @fuckindia 2 роки тому +2

    Yes Very Useful 100% satisfied as I didn't knew this is like tresure😍🎵

  • @MindfulMakeup
    @MindfulMakeup Рік тому +1

    It doesn't show any keyboard shortcuts list in Jupyter notebook when I press . Quite strange.

    • @ReuvenLerner
      @ReuvenLerner  Рік тому

      Hmm... you have to be in command mode. Make sure to press ESC first. Otherwise... I dunno!

  • @sajolsajol8393
    @sajolsajol8393 Рік тому +1

    great video....thank you....

  • @geoblackgeo1
    @geoblackgeo1 2 роки тому +1

    Great stuff! To Split cells in Windows place the cursor where you want the split and then ctrl shift minus.

    • @geoblackgeo1
      @geoblackgeo1 2 роки тому

      cursor must be at the beginning of the line

  • @archit617
    @archit617 2 роки тому +1

    Wow what a great video, Crisp and to the point.

  • @mohammadadrees5263
    @mohammadadrees5263 2 роки тому +1

    Thank you sir. This video was very helpful for me.

  • @DartEremite
    @DartEremite 2 роки тому +1

    You blow my mind!!! Amazing!!!

  • @ajaysharma-gw1vy
    @ajaysharma-gw1vy 2 роки тому +1

    learned something new today..thanks for posting..

  • @bhaskaruprety230
    @bhaskaruprety230 4 роки тому +2

    As expected that is a very useful video.
    Thanks

  • @pardhu1529
    @pardhu1529 2 роки тому +1

    Thank you soo much !

  • @shadaflorida4248
    @shadaflorida4248 3 роки тому +2

    this is an AMAZING video !! thank you soo much, so helpful and clear

  • @qasimabbasi.
    @qasimabbasi. 2 роки тому +1

    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.

    • @ReuvenLerner
      @ReuvenLerner  2 роки тому +1

      I've gotten another request to talk about my typing speed -- so I'll make a video about that soon!

  • @cholponzhakshylykova4099
    @cholponzhakshylykova4099 2 роки тому +1

    It is indeed a very helpful video, thanks for uploading it!

  • @landrew13577
    @landrew13577 3 роки тому +1

    Very useful,thanks

  • @saiswarna3004
    @saiswarna3004 2 роки тому +1

    Thank you so much for this video! 😇

  • @knowledgelover2736
    @knowledgelover2736 3 роки тому +1

    why does this video not have 10MM views?

  • @ramanverma3166
    @ramanverma3166 2 роки тому +1

    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...??

    • @ReuvenLerner
      @ReuvenLerner  2 роки тому

      I sometimes press ESC then ENTER, just to see where my cursor is. Hope this helps, and glad you enjoyed the video!

    • @ramanverma3166
      @ramanverma3166 2 роки тому +1

      @@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.

    • @ReuvenLerner
      @ReuvenLerner  2 роки тому

      @@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.

  • @debatradas1597
    @debatradas1597 3 роки тому +1

    Thank you so much 😇

  • @AY-ln1mk
    @AY-ln1mk 2 роки тому +1

    amazing video, thank you!

  • @billnicholson6742
    @billnicholson6742 3 роки тому +1

    Terrific video! In command mode, is there a way to copy multiple non-adjacent coding cells and paste them?

    • @ReuvenLerner
      @ReuvenLerner  3 роки тому

      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.

  • @Madhavan2020
    @Madhavan2020 6 днів тому +1

    For some reason, the last trick, 'f' find+replace is not working for me. I am not getting the dialogue box

    • @ReuvenLerner
      @ReuvenLerner  6 днів тому

      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!)

  • @niteeshkumar6664
    @niteeshkumar6664 3 роки тому +1

    Nice Explanation Dear sir....

  • @JuanRivera-fb4sk
    @JuanRivera-fb4sk 3 роки тому +1

    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.

    • @ReuvenLerner
      @ReuvenLerner  3 роки тому +1

      You can comment/uncomment Python code with control-/ (slash). Just highlight the text you want to comment, and hit that key combination.

    • @JuanRivera-fb4sk
      @JuanRivera-fb4sk 3 роки тому

      @@ReuvenLerner thank you so much

  • @chillwithme798
    @chillwithme798 2 роки тому +1

    very useful, thanks you so much!

  • @princeprajwal
    @princeprajwal 3 роки тому +1

    That was very useful sir

  • @zeerakkhan274
    @zeerakkhan274 2 роки тому +1

    Great Great Video Buddy. Super Handy.

  • @zknolz
    @zknolz 2 роки тому +1

    good job sir

  • @darkphysics4561
    @darkphysics4561 3 роки тому +1

    Great video and awesome explanations!

  • @MikeM-uy6qp
    @MikeM-uy6qp 4 місяці тому +1

    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.

    • @ReuvenLerner
      @ReuvenLerner  3 місяці тому

      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.

  • @beautifulbae7923
    @beautifulbae7923 2 роки тому +1

    What’s the easiest way to get brackets () without pressing shiftttt then bracket button?

    • @ReuvenLerner
      @ReuvenLerner  2 роки тому

      Jupyter can't help you there, I'm afraid -- try remapping your keyboard, or getting one with dedicated () keys.

  • @basketball_fan409
    @basketball_fan409 4 роки тому +1

    Hi, I wanted to know what my professor may mean when he is referring to "a block" in Jupyter, thanks and loved the video!

    • @ReuvenLerner
      @ReuvenLerner  4 роки тому +2

      "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!

  • @MrMallesh1
    @MrMallesh1 Рік тому +1

    great , liked it !

  • @roushanraj3009
    @roushanraj3009 3 роки тому +1

    TYSM for these tips....really helped a lottttttt...

  • @abhisekhkumar4948
    @abhisekhkumar4948 2 роки тому +1

    nothing, nobody made me to subscribe anyone so quick.

  • @jayanth6492
    @jayanth6492 4 роки тому +1

    Thanks.That's very useful

  • @pankajkumar-zm9sr
    @pankajkumar-zm9sr 2 роки тому +1

    thanks a lot

  • @zahraafadhel7284
    @zahraafadhel7284 10 місяців тому +1

    How to retrieve the icons on notebook?i change themes by using jt -1 orders

    • @ReuvenLerner
      @ReuvenLerner  10 місяців тому

      What icons do you want to retrieve?

  • @knowledgelover2736
    @knowledgelover2736 3 роки тому +1

    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.

    • @ReuvenLerner
      @ReuvenLerner  3 роки тому +1

      Sorry, I don't know! Maybe you are somehow accidentally getting into edit mode, rather than command mode?

    • @KapilMarwaha
      @KapilMarwaha Рік тому +1

      Note that for this you need to be in EDIT mode and not Command Mode. See the outline in the video. it is green.​

    • @knowledgelover2736
      @knowledgelover2736 Рік тому

      Thanks. I will pay attention for that

  • @shaonhassan7056
    @shaonhassan7056 2 роки тому +1

    How can i make multiple cells in jupiter notebook to put multiple inputs?

    • @ReuvenLerner
      @ReuvenLerner  2 роки тому

      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.

  • @meetkcs
    @meetkcs 2 роки тому +1

    Excellent 👍

  • @zeeza8241
    @zeeza8241 3 роки тому +1

    how to get signatures or how to know what values have to go into the function.

    • @ReuvenLerner
      @ReuvenLerner  3 роки тому

      Type annotations are a great, important, and useful tool... but they aren't used much in Jupyter notebooks, so far as I know.

  • @dienhoang4469
    @dienhoang4469 3 роки тому +1

    Thanks you, very helpfull !

  • @nedex3843
    @nedex3843 2 роки тому +1

    Is there a shortcut for the help function.

  • @Robert-bw6jk
    @Robert-bw6jk 3 роки тому

    Need to remember that a and b is for above and below, not by after and before.

  • @_iamankitt_
    @_iamankitt_ 3 роки тому +1

    Legend 🙌🏻

  • @krishnabarfiwala5766
    @krishnabarfiwala5766 3 роки тому +1

    Hi, in my windows 10 control-_ underscore didn't work. to split the codes into different lines.

    • @ReuvenLerner
      @ReuvenLerner  3 роки тому

      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!

    • @krishnabarfiwala5766
      @krishnabarfiwala5766 3 роки тому

      @@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?

  • @sumittripathi1331
    @sumittripathi1331 4 роки тому +2

    Helpful...thanku

  • @md.shafaatjamilrokon8587
    @md.shafaatjamilrokon8587 3 роки тому +1

    Thanks

  • @rchoksey3587
    @rchoksey3587 4 роки тому

    Everyone keeps talking about command mode. What exactly is it and how do we access it to use the shortcuts?

    • @ReuvenLerner
      @ReuvenLerner  4 роки тому +1

      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.

  • @nitishsonkar2408
    @nitishsonkar2408 2 роки тому +1

    can we run single line code in jupyter notebook

    • @ReuvenLerner
      @ReuvenLerner  2 роки тому

      Sure! You can enter as many (or as few) lines as you want in a cell, and then run them.

    • @nitishsonkar2408
      @nitishsonkar2408 2 роки тому +1

      @@ReuvenLerner Thank you so much

  • @aguud
    @aguud 3 роки тому

    thank you so much

  • @icudednow
    @icudednow 3 роки тому

    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

    • @ReuvenLerner
      @ReuvenLerner  3 роки тому

      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.

  • @Christopher-go5zr
    @Christopher-go5zr 3 роки тому

    how to able toggle toolbar after disabling it , its not showing when i click on toggle toolbar option again

    • @ReuvenLerner
      @ReuvenLerner  3 роки тому

      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.

  • @RalphNgOfficial
    @RalphNgOfficial 3 роки тому +1

    How to delete a selected Cell?
    I tried "cmd + D, D" but it doesn't works

    • @ReuvenLerner
      @ReuvenLerner  3 роки тому +1

      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.

    • @epikepik7082
      @epikepik7082 3 роки тому

      Double D key

  • @niteshpatil8595
    @niteshpatil8595 4 роки тому

    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...??

    • @ReuvenLerner
      @ReuvenLerner  4 роки тому

      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?

    • @ucankaplumbaga1
      @ucankaplumbaga1 4 роки тому

      You can try Alt + Enter

  • @AmeyaBurade07
    @AmeyaBurade07 3 роки тому

    Hello I mistakenly deleted complete file how can I restore it

    • @ReuvenLerner
      @ReuvenLerner  3 роки тому

      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.

  • @mahadev1050
    @mahadev1050 3 роки тому +1

    Amazing👍

  • @imanefahim8557
    @imanefahim8557 3 роки тому

    How to delete full folders without having to go through all of the subfolders and empty them before deleting the main folder??

    • @ReuvenLerner
      @ReuvenLerner  3 роки тому

      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.

    • @imanefahim8557
      @imanefahim8557 3 роки тому +1

      @@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!?

    • @ReuvenLerner
      @ReuvenLerner  3 роки тому

      @@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!

    • @imanefahim8557
      @imanefahim8557 3 роки тому +1

      @@ReuvenLerner yeah I understand, I solve it actually. Thanks 😊

    • @imanefahim8557
      @imanefahim8557 3 роки тому

      @@ReuvenLerner Do you have a video explaining how to move your project from Jupyter notebook to local python?

  • @Christopher-go5zr
    @Christopher-go5zr 3 роки тому

    how to increase or decrease text size

    • @ReuvenLerner
      @ReuvenLerner  3 роки тому

      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.

  • @shreyadhurde4301
    @shreyadhurde4301 3 роки тому +1

    Wowo

  • @MichaelT_123
    @MichaelT_123 2 роки тому +1

    Great tutorial ... for lazy people! 😉

  • @akhilnama1989
    @akhilnama1989 3 роки тому +1

    Thanks