top of page

Auto-complete feature in Jupyter notebook

  • neovijayk
  • Jul 6, 2020
  • 2 min read

Many of the data scientists don’t know how to use the auto-complete option in Jupyter notebook. It is very useful feature and will surely help to increase your productivity at the time of coding.

But how to use this feature in Jupyter notebook?

To use the auto-completion you just need to press the Tab button and it will complete show the options from which you can select the required one. This kind of feature saves time also pron to introduce less bug in the code.

Let’s see one by one by using examples below:

Auto-complete of package name:

At the time of import if you want to import library and you typed few initial letters of the package and pressed Tab button the list of packages having the name starting with that initial letters will be list down in the option from which we can make a selection.


For example in the adjacent picture one can see at the time of importing Pandas library I types the first thee letters and pressed the Tab button and one can see the available option including Pandas in it. In the same way you can try it your self.

Auto-complete function names:

To search for the available functions in the imported packages:

For example if I want to search the functions in Pandas library with the name starting with re I will simply type the pd.re and press the Tab button this will show me the available functions in Pandas as shown in the picture-1 in the following slide:

To call the already defined function in the notebook:

Similarly if I want to call the function which I have defined already in the notebook as shown in the picture-2 in the above slide I will just type the initial letters of the function and press the Tab.

Auto-complete defined variable names


Now in case variables it is applicable too. I have defined a list, dictionary, a value and a string starting with temp_ as shown above in the picture. After defining them when in the new cell of the notebook I type the name and press the Tab button I can see the the names as shown in the above picture.

As one can see the benefit of using this feature in the Jupyter notebook if you have very lengthy code having different functions, packages and variables defined then using simple Tab can save time in scrolling up and down also reduces the chances of errors and increases the speed of the coding with confidence.

That’s it for this article. If you find this article useful please like and subscribe to my blog for the new updates.



Comments


Subscribe to BrainStorm newsletter

For notifications on latest posts/blogs

Thanks for submitting!

  • Twitter
  • Facebook
  • Linkedin

© 2023 by my-learnings.   Copy rights Vijay@my-learnings.com

bottom of page