Русские Блоги
Функция подсказки и дополнения кода Jupyter Notebook
1. Функция завершения кода
Нажмите Tab для завершения
2. Функция подсказки кода
1. Откройте Anaconda Navigator, щелкните Среды -> база (корень) -> Открыть терминал:
2. Введите следующие 4 команды во всплывающем окне команд:
Процесс установки выглядит следующим образом:
После завершения установки откройте Jupyter Notebook и щелкните вкладку Nbextensions на панели вкладок страницы корневого каталога:
Проверьте Hinterland:
Проверка:
Реализована функция подсказки кода Jupyter Notebook! ! !
Интеллектуальная рекомендация
Меч относится к предложению + 43: количество N сиша + Java
Оригинальное название: бросить кубики на землю, все точки кости сталкиваются с точкой точки кости. Введите n, напечатали вероятность всех возможных значений. (6 сторон каждой кости, точки от 1 до 6) Р.
![]()
Введение в Python 4
функция ввода Использование функции Функция input () является функцией ввода. Функция input () — это функция ввода. Когда вы пишете вопрос в скобках функции, функция input () будет отображать вопрос в.
Основные операции в R 01
Повторите основную операцию секретной книги ниндзя языка R учителя Се Иихуэй.
Мастерство, создание американской легенды очистки воды
Мастера — это не только технические специалисты и квалифицированные мастера, которые могут решить некоторые практические проблемы в производстве и жизни, но также авангарды, которые могут руководить п.
курсы памяти Лу Feifei (а, понимать память понимания мозга)
Понимание памяти, что память? Понимание памяти, что память? 1 Понимание мозга 2 Что такое память Функция 3 Память 3.1 общие воспоминания путь 3.2 Факторы, влияющие на память 4 запоминающий материал Че.
How to enable Autocompletion in Jupyter Notebook application
The original article on the Refinitiv Developer Community is available here.
Overview
With the rise of Data Scientists, Financial coders, Casual Developers, or Traders (aka Citizen Developers), and the rapid growth of Jupyter application, Jupyter Notebook and its next-generation, JupyterLab is a de-facto tool of those Citizen Developers. Thanks to the IPython kernel, Notebook provides a powerful interactive shell, interactive data visualization, embedded documentation, and supports various programming languages such as Python (native supported), R, Julia, and much more.
The Notebook application is easier to use when comparing to other traditional IDEs (Integrated development environment) or Editors. Citizen Developers do not need much programming language or technology experience to use the Notebook application. However, The Jupyter Notebook also provides Coding and Magic features which make Notebook a friendly development environment for both Citizen and Professional Developers.
This article demonstrates how to enable Python/Jupyter application coding autocompletion feature. The demo application uses content from the Refinitiv Data Platform (RDP) as an example library.
Introduction to Refinitiv Data Platform (RDP) Libraries
Refinitiv provides a wide range of contents and data which require multiple technologies, delivery mechanisms, data formats, and the multiple APIs to access each content. The RDP Libraries are a suite of ease-of-use interfaces providing unified access to streaming and non-streaming data services offered within the Refinitiv Data Platform (RDP). The Libraries simplified how to access data to various delivery modes such as Request-Response, Streaming, Bulk File, and Queues via a single library.
Depending on the level of service and data requirements, developers can easily choose how to access data services using the appropriate access channel defined within the library.
Using the library developers can access content from all 3 of the access points — all from within the same application if required. The RDP Libraries are available in the following programming languages:
- Refinitiv Supported Editions: Python and TypeScript/JavaScript (coming soon)
- Community-based Edition: C#
For more deep detail regarding the RDP Libraries, please refer to the following articles and tutorials:
Disclaimer
As this notebook is based on alpha version 1.0.0a7.post7 of the Python library, the method signatures, data formats, etc. are subject to change.
Python built-in help
You can install RDP Libraries — Python and JupyterLab in your environment with the following basic pip command:
The Python programming language comes with a built-in help() function to display documentation of modules, functions, classes, objects, etc with the following syntax:
However, the result is not always easy to read as the following examples:
For the library that keeps involving like RDP Libraries, this is inconvenient even the RDP Library itself is easy to use.
IPython Autocompletion
Fortunately, the JupyterLab and Jupyter Notebook comes with the IPython magic command %config Completer.use_jedi = False that enables the library/function autocompletion (like IntelliSense in Microsoft development environment term).
You need to set the magic command %config Completer.use_jedi = False at the top cell of the Notebook application (like this Notebook).
Once you have enabled and run the %config Completer.use_jedi = False magic command, you can trigger the code autocompletion by pressing the tab button after the "." character.
The magic %config Completer.use_jedi = False command also enables the "shift + tab" buttons to show the function help and tooltip information.
These autocompletion shortcuts also support the library properties/attributes as well.
Please note that all IPython helpers and autocompletion magic support all Python libraries in the Notebook environment, not limit to only RDP Libraries.
Refinitiv Workspace CodeBook
If you are Refinitiv Workspace or Eikon user, you can access CodeBook, the cloud-hosted Jupyter Notebook development environment for Python scripting from the application. The CodeBook is natively available in Refinitiv Workspace and Eikon as an app (no installation required!!), providing access to Refinitiv APIs that are already pre-installed on the cloud.
One benefit of using the CodeBook app is the environment has already enabled Jupyter Notebook magics for you. You can use all code autocompletion shortcuts ( tab , shift + tab , and ? ) without setting any IPython Magic in your Notebook.
Prerequisite
This demo project requires the following dependencies software.
- RDP Access credentials. .
- Python Anaconda or MiniConda distribution/package manager. .
- Internet connection.
Please contact your Refinitiv’s representative to help you to access Refinitiv Data Platform credentials. You can generate/manage the AppKey from the AppKeyGenerator website or AppKey Generator tool in Eikon Desktop/Refinitiv Workspace application.
How to run the example
Please unzip or download the example application from GitHub into a directory of your choosing, and then follow the step-by-step instruction in Running the example Notebook of the project README.md file.
Conclusion and Next Step
Some Professional Developers may think Jupyter Notebook (and JupyterLab) is just a learning tool for Casual Developers like Data Scientists. However, the tool provides enough coding/development features for a wide range of Developers. The IPython Code Autocompletion feature (and other Magics) helps developers implement the code logic and navigate through the libraries/APIs in the same experience as the traditional IDEs.
There is some new development project that tries to merge the benefits/features of the traditional IDEs and Jupyter Notebook like Netflix’s Polynote. While the JupyterLab also keeps evolving to make a better development environment and easier to use.
At the same time, the Refinitiv Data Platform (RDP) Libraries let developers rapidly access Refinitiv Platform content with a few lines of code that easy to understand and maintain. Developers can focus on implement the business logic or analysis data without worry about the connection, authentication detail with the Refinitiv Platforms.
References
You can find more details regarding the Refinitiv Data Platform Libraries and Jupyter Notebook from the following resources:
-
on the Refinitiv Developer Community web site. . . . . . . . . . . .
For any questions related to this article or Refinitiv Data Platform Libraries, please use the Developers Community Q&A Forum.
Autocomplete your code in Jupyter Notebook
Jupyter Notebook is often used as a Python development environment, but code completion is not enabled by default. That’s why it’s a bit of a problem when importing packages. This time, I introduce some tips for code completion in Jupyter Notebook.
Autocomplete the code
Code completion in the IDE is an important feature for smooth implementation of the program. Some people call it autocomplete , and others call it intelli sense, but the functions are the same.
I investigated how to enable autocompletion when coding in Jupyter Notebook, so I’ll leave it as a reminder.
Method 1: Use IPCompleter.greedy
Here’s the easiest way to do it first. Just open any Notebook file and run the following magic command.
Press the Tab key to display the input completion.
However, there is a one-tempo delay until the candidate is displayed after the typing key. In my environment, I had to wait about 1-2 seconds.
Method 2: Use autocompletion of Nbextensions
Next, I’ll show you how to use the library to introduce Jupyter Notebook’s extensions at once.
The following command assumes that Jupyter Notebook is already installed.
After that, restart Jupyter Notebook and you will see that a new tab labeled “Nbextentions” has been added.

Activate Hinterland for code completion .
You can also press the Tab key to display the input suggestions. I recommend Hinterland because the time to display candidates is faster than IPCompleter.greedy .

Conclusion
I showed you how to use code completion on Jupyter Notebook. I recommend you to use the autocompletion of Nbextensions in Method 2. It’s quick to complete, and it’s very helpful because it will show you candidates even when you’re typing.
How to Enable and Use Autocomplete in Jupyter Notebook
The code autocomplete feature by default included in most of the source code editors through which you can view IntelliSense menu or code suggestions inside the drop-down in a program file. The code autocomplete functionality saves you time for writing complex programs, receives fewer bugs, and you can quickly include methods, attributes, and classes in your code using drop-down suggestions.
In this article, we will show how to enable and use the autocomplete in the Jupyter notebook using different methods. Before starting the demo, the Jupyter notebook environment should be running on your system.
Autocomplete Feature in Jupyter Notebook
Most programmers who use the Jupyter environment for the first time wonder how to use code auto-completion in an IPython notebook. For those users, it is surprising and the good news is that you do not need to install any external tool for using the autocomplete feature in the Jupyter notebook. The autocomplete feature comes with the standard Jupyter notebook setup.
The auto-completion in the Jupyter notebook helps you to choose an appropriate object, modules, classes, and variables inside the notebook. In this way, you can complete your code efficiently and in an easier way.
Autocomplete in Jupyter Notebook Using Tab Control
To use the code auto completion, you have to type the module, object, or class name and then hit the ‘Tab’ button from your keyboard. After pressing the Tab key, the completed suggestions appear in the drop-down box that is shown in the following example:
For example, we import a pandas library for solving data science problems. When you create a new object, the autocomplete option also helps you in object creation, which is shown in the following screenshot:

You can also use the auto-completion in the Jupyter notebook when you already have an object and you want to assign it to a variable. Using the autocomplete, you can access the list of parameters and methods of the typed prefix object. For example, the DataFrame object contains various methods and parameters that you can easily access after the ‘.’ dot. Type the first letter of the method and press ‘Tab’ as follows:

The auto-completion used to import the names of the modules in your Jupyter notebook. The autocomplete features will help you because in most cases you do not remember the exact name of a particular library. However, you know this library provides cool algorithms. To import this module, just type the first one or two letters and then press the ‘Tab’ key from your keyboard. The related suggestions would display under the box as follows:

Choose the desired module, which you want to add to an IPython notebook.
You can also use the autocomplete in the Jupyter notebook while you want to reuse variables, classes, or attributes inside a program. For example, we have initialized two test variables in our program. When we type the prefix of a variable that also start starts with the same letter and press the ‘Tab’ key, it shows us the relevant variable name suggestions in the drop-down box as follows:

Only one variable will show in suggestions instead of many choices. In this case, it will type the full variable name for us.
Auto-completion is also helpful, when you press the ‘Shift+Tab’ keys, it shows the function help, type, and tooltip information in a box as follows:

The use of ‘?’ after the function name without using ‘()’ shows the object documentation and methods documentation in the IPython notebook that you can see in the following screenshot:

All auto-completion shortcuts ‘Tab, Shift+Tab, and ?’ by default are enabled in Jupyter notebook without using any extension or a plugin.
Add IntelliSense or Auto-completion in Jupyter Notebook Using the Hinterland Extension
To add the code IntelliSense or auto-completion in the Jupyter notebook, you can use a Jupyter ‘hinterland’ extension. Most users unable to find how to install this extension through the pip package manager directly. Therefore, you can enable this extension in your Jupyter notebook by using the following steps:
Step 1: First, install the jupyter contrib nbextensions by executing the following command in the terminal:

Step 2: Install the CSS and js files for the jupyter environment by using the following command:

Step 3: In the last step, you need to enable the ‘hinterland’ extension
The following output shows in the terminal:

Now, again restart the Jupyter notebook kernel online. Import the modules and create objects. You will notice that auto-completion or IntelliSense automatically shows in the drop-down without using the ‘Tab’ control in the Jupyter notebook as follows:

There are more extensions used for auto-completion but users prefer to use the hinterland and Tab option for auto-completion in the Jupyter notebook.
Conclusion
We have discussed in this tutorial how to enable and use auto-completion or IntelliSense functionality in the Jupyter notebook. We have seen how the ‘Tab, Shift+Tab, and ?’ help us in writing code in a Jupyter notebook. We have also demonstrated how to install and enable hinterland extension in Jupyter notebook for using the code autocomplete feature.
About the author
Samreena Aslam
Samreena Aslam holds a master’s degree in Software Engineering. Currently, she’s working as a Freelancer & Technical writer. She’s a Linux enthusiast and has written various articles on Computer programming, different Linux flavors including Ubuntu, Debian, CentOS, and Mint.