The paper contains 1786 words and is expected to last 4 minutes

Notebooks display results and share code most efficiently, which was not easy to implement in previous IDEs. However, there are still areas for improvement.

In the text editor, it is desirable to have some features that are not default in Jupyter. But don’t worry. Just like Python, Jupyter has third-party extensions.

This article focuses on some of the most useful extensions.

1. Foldable titles

Collapsible titles are an extension that makes the notebook process easier to understand and helps create a concise notebook.

To get this functionality, install the Jupyter_contrib_nbex package with this command in a terminal window:

conda install -c conda-forge jupyter_contrib_nbextensions

Once the package is installed, you can start Jupyter Notebooks using the following methods:

Jupyter Notebooks

Once you enter the Main page of Jupyter, you see that a new TAB has been created for NBExtensions.


Then you can use this package to get a lot of extensions.

The rendering page is as follows:

2. Automatic import

Automation is the future.

It was frustrating to copy and paste many libraries and default options for some of the items every time a new Jupiter Specialization was opened in a data science program.

Common import tools:

· Pandas and numpy — In my opinion, Python must have both as default import tools

Seaborn, matplotlib, plotly_express

· Change some of the default options for pandas and Seaborn

Here is the script that has been pasted countless times.

import pandas as pdimport numpy as npimport plotly_
express as pximport seaborn as snsimport matplotlib.pyplot as plt%matplotlib inline
# We dont Probably need the Gridlines. Do we? 
If yescomment this linesns.set(style="ticks")
# pandas defaultspd.options.display.max_columns = 500pd.options.display.max_rows = 500Copy the code

Is there a way to import it automatically?

Just click the NbexTensions TAB and select the Snippets extension feature.

For snippets. Json file to make the following changes, can be in/miniconda3 / envs/py36 / share/jupyter nbextensions/snippets found the file. Here py36 is Conda VirtualEnv. Note that changes do not have to be made in site-Packages.

Here is a practical application of this extension:

Great, right? We can also use it to create basic code snippets for deep learning notebooks and NLP based notebooks.

3. Execution time

We typically use %time and decorator-based timer functions to measure function time. But now you can do the same with this great extension.

And it looks great.

Just select the ExecutionTime extension from the NBextensions list, and after each execution of the cell, you will get an execution result at the bottom of the cell, along with the time that the cell was executed.

4. Other extended functions

NBExtensions has many extended features. Here are some of the other features:

· Limited output: Your laptop has been frozen since you printed a lot of text on it. This extension limits the number of characters that can be printed below a code cell.

· 2-3 converter: The old Python2 notebook has problems or is tired of changing print statements. This extension is a good choice.

· Live Marker Preview: Some people like to blog using markers on the Notebooks of Jupyter. The system is sometimes prompted to be busy due to errors in writing. You can now see a live preview of the output rendered by tagged cells when you edit their source code.

conclusion

The JUPyter_GRUb_nbextension software package is running well.

It makes our lives a lot easier when it comes to checking execution time, scrolling through notebooks, and repetitive tasks.

The package also provides many other extensions. Be sure to take a look and see what works for you.

Also, to learn more about Python 3.0, recommend the University of Michigan’s premium course on Learning Intermediate Python.

Leave a comment like follow

We share the dry goods of AI learning and development. Welcome to pay attention to the “core reading technology” of AI vertical we-media on the whole platform.



(Add wechat: DXSXBB, join readers’ circle and discuss the freshest artificial intelligence technology.)