The interactive features of Jupyter Notebook provide instant feedback on the results of code processing. In editing mode, you can switch between code and Markdown states, so that code and documents can be maintained together.

What can Jupyter Notebook do?

In the environment of Jupyter Notebook, ides such as PyCharm and VSCode cannot effectively view the source code of each package and know exactly how to use the function when developing or analyzing Python. Here are some tips that are in line with the interactive characteristics of Jupyter Notebook:

To see what a function or package does:

Method 1: the help() function

Pass the name of the function or package to query to help() and return a description of its functionality

Pass in the built-in function and return the explanation part of the function

Pass in the package name and return the __doc__ text in the package __init__.py file

Method 2:?

The function is similar to help(), except that the feedback for help is in the code output, whereas? In a front shell layer

Method 3: __doc__

Same as method 1,2, it’s a string, not intuitive

See what functions the package has

Method 1: dir ()

Use help() to see what dir() does: returns the package’s __dir__ methodExample: Import numpy and print out a list of numpy methods

Method 2: __dir__ ()

It’s the same thing as mode 1

Using a combination of the help() and dir() functions, we can quickly explore package methods or functions

In Python development or analysis, you’re constantly exposed to new packages, and this is the most direct way to see what each method does.

After all, to find answers on the Internet, the quality of information is uneven, often have to do screening, resulting in an unnecessary waste of time.

Recursive calls

Of course, both help() and dir() can call themselves

Help () See what help() does

Dir () Method of viewing dir()