How can we call the documentation for NumPy and SciPy?


If you are unsure of how to use a particular function or variable in NumPy and SciPy, you can call for the documentation with the help of ‘?’. In Jupyter notebook and IPython shell we can call up the documentation as follows −

Example

If you want to know NumPy sin () function, you can use the below code −

import numpy as np
np.sin?

Output

We will get the details about sin() function something like as follows −

We can also view the source with the help of double question mark (??) as follows −

import numpy as np
np.sin??

Similarly, if you want to see the documentation and source of a particular SciPy function, you can use single question mark (?) and double question mark (??). Let’s have a look at the example below −

Example

from scipy import io as scio
scio.loadmat?

Output

View the source of loadmat() function as follows

from scipy import io as scio
scio.loadmat??

Updated on: 23-Nov-2021

109 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements