简体   繁体   中英

How to look for functions in numpy and regular python

I have seemed to forgot the command to look for functions in python and in numpy? Are there shortcuts that one can use to search for functions in numpy and python? I know help is used assuming you know the name of the function. Is the function lookfor?

I think you are looking for help() and/or dir() . Try:

import os

help(os)

and:

dir(str)
In [9]: import numpy as np

In [10]: dir(np)[-10:]
Out[10]:
['vectorize',
 'version',
 'void',
 'void0',
 'vsplit',
 'vstack',
 'where',
 'who',
 'zeros',
 'zeros_like']

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM