No matter how good you are in programming with respect to a language like python you may not be able to remember all the functions names or syntax or function parameters. So you may require to use intellisense or autocomplete feature of Jupyter notebook while programming in pandas, python and similar libraries.
You may like to read how to use Amazon CodeWhisperer to Generate Code
What is intellisense or autocomplete?
IntelliSense or autocomplete is a feature commonly found in integrated development environments (IDEs) and text editors that provides context-aware suggestions as you type code. The goal of IntelliSense is to improve the productivity of developers by reducing the time and effort required to write code.
When you start typing a statement in an IDE with IntelliSense, the IDE will analyze the context of your code and present a list of suggestions based on what you have typed so far.
For example, if you start typing a variable name, IntelliSense may suggest the names of variables that are defined in the current scope, along with their data types. If you start typing a method name, IntelliSense may suggest methods that are available for the object that you are working with.
What are the advantages of intellisense or autocomplete?
IntelliSense can help you avoid syntax errors, by highlighting potential issues as you type and offering suggestions for correcting them. It can also help you discover new functions, methods, or classes that you may not have been familiar with, by presenting them as suggestions as you type.
Autocomplete is a similar feature that provides suggestions as you type, but focuses on completing the text that you have already started typing. Autocomplete will suggest the most likely text based on what you have typed so far, and you can then choose the suggestion that you want to complete your statement.
Yes it is possible to use IntelliSense and autocomplete in Jupyter Notebook.
As you can see in above image, you just need to press TAB key after typing the dot after np and you will get all the functions related to numpy.
Similarly if you want to see the parameters or signature of a function, type the function name and then the opening bracket of the function and then press Shift+Tab as shown below.
If somehow the intelliSense of your Jupyter notebook is not working, below information may be helpful
You may activate IntelliSense in Jupyter Notebook in two different ways:
- Using the package jupyter-contrib-nbextensions. This package offers a number of Jupyter Notebook extensions, including an autocomplete extension.
You can enter the following command at a command prompt or terminal to install the package:
pip install jupyter_contrib_nbextensions
2. Using the jupyter-autocomplete package:
This package provides a simple autocomplete feature for Jupyter Notebook, and can be installed by running the following command in your terminal or command prompt:
pip install jupyter-autocomplete
If you want to learn more about Jupyter Notebook Click Here.
IntelliSense and autocomplete can significantly improve the speed and efficiency of writing code, by reducing the time and effort required to type and remember code, and by highlighting potential issues as you work.
I hope you enjoyed this article and can start using some of the techniques described here in your own projects soon.
You may like to read our other popular posts as below: