简体   繁体   English

如何在numpy和常规python中查找函数

[英]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? 我似乎已经忘记了在python和numpy中查找函数的命令? Are there shortcuts that one can use to search for functions in numpy and python? 是否可以使用一些快捷方式来搜索numpy和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() . 我认为您正在寻找help()和/或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']

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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