Get help of python and python package function/获取python及python包函数的帮助文档

2023-05-16

摘要:快速获取函数的帮助文档是阅读陌生程序的需求,也是学习编程语言的有效方法。对于python和python包,均有这样的支持。这里以numpy为例,说明其获取帮助的方法,其一使用包提供的帮助函数,其二查找帮助文档,当然还有其三万能的google。

Method 1: using help function or method

For general python function, help() function return the help of general python functions.

e.g.

help(max)

For numpy methods (functions), np.info() method return the help of numpy methods (functions).

e.g.

import numpy as np

np.info(np.maximum)

 

Method 2:using reference doc

search in ‘Index’ of reference doc

https://docs.scipy.org/doc/numpy/numpy-ref-1.14.5.pdf

e.g. maximum in page 826 of reference book

Function:

numpy.maximum(x1, x2, /, out=None, *, where=True, casting=’same_kind’, order=’K’, dtype=None, subok=True[, signature, extobj]) = <ufunc ‘maximum’>

Description:

Element-wise maximum of array elements.

Compare two arrays and returns a new array containing the element-wise maxima. If one of the elements being compared is a NaN, then that element is returned. If both elements are NaNs then the first is returned. The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are propagated.

Example:

data = numpy.random.randn(10,20)

data_relu = numpy.maximum(data, 0)

# get max of data and 0

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Get help of python and python package function/获取python及python包函数的帮助文档 的相关文章

  • PL/SQL基础(3):小专题

    本篇是 Oracle基础小结 系列之一 这里汇集了使用PL SQL中遇到的一些小问题和相关小专题文章的链接 xff0c 目前列出来一些 xff0c 后面还会陆续添加 专题1 xff1a 字符串函数和字符串截取 对于在使用存储过程中习惯性使用
  • 阿里云云效Maven制品仓库的ip白名单列表

    阿里云的云效提供了一系列的云开发工具 xff0c 其中包括 Maven 制品仓库 xff0c 可以提供便捷的 mvn 私库服务 但是因为公司基于安全考虑 xff0c 防火墙策略非常严格 xff0c 仅允许 ip 白名单列表内的数据包可以正常
  • Dokuwiki安装(linux)

    Dokuwiki安装 xff08 linux xff09 一 简介 dokuwiki是一个开源wiki引擎程序 xff0c 运行于PHP环境下 无需数据库 Doku Wiki 程序小巧而功能强大 灵活 xff0c 适合中小团队和个人网站知识
  • 1、Oracle PL/SQL中的字符串及函数介绍

    该文章是 PL SQL基础 xff08 3 xff09 xff1a 小专题 系列文章之一 Oracle中常用的字符串类型有 xff1a 固定长度 xff08 CHAR等 xff09 可变长度 xff08 VARCHAR2等 xff09 和大
  • 2、Oracle PL/SQL字符串分割截取

    该文章是 PL SQL基础 xff08 3 xff09 xff1a 小专题 系列文章之一 Oracle中的instr和substr函数 Oracle PL SQL中可以通过instr xff08 获取特定字符串的索引 xff09 和subs
  • 4、Oracle PL/SQL编译错误查看与处理

    该文章是 PL SQL基础 xff08 3 xff09 xff1a 小专题 系列文章之一 在编译Oracle PL SQL函数等时 xff0c 难免会遇到错误 例如 xff1a Function GETSTR1 已编译 Errors che
  • 3、Oracle PL/SQL中Date格式及格式转换

    该文章是 PL SQL基础 xff08 3 xff09 xff1a 小专题 系列文章之一 Oracle 插入日期 xff08 时间 xff09 时报错 xff1a ORA 01861 文字与格式字符串不匹配 这是由于插入的日期格式和数据库现
  • 5、Oracle数据库insert后获取自增的ID

    该文章是 PL SQL基础 xff08 3 xff09 xff1a 小专题 系列文章之一 在 insert 后使用 select 序列名 CURRVAL from dual 可以获取 insert后自增的ID 具体 SQL 语句 xff1a
  • 解决cmd 中ping>nul语句提示命令符无法识别

    问题描述 xff1a 在批量使用chrome exe ftp data hdf amp ping n10 127 0 0 1 gt nul 下载数据时 xff0c 命令行没有因为ping命令暂停 解决 xff1a 怀疑是ping这部分命令存
  • C#控件限制输入字符数且可用退格

    对于C 控件 xff08 例如textbox xff09 的输入限制长度 xff0c 直接想到的方法是在控件的KeyPress事件时判断控件已有的字符数来限制 假设控件名称为DAForm myBox4 xff0c KeyPress事件简单的
  • XXX事件的重载均与委托"System.EventHandler"不匹配

    在给动态创建控件添加事件时容易遇到的一个错误就是 xff1a XXX事件的重载均与委托 34 System EventHandler 34 不匹配 假设控件是MovePicBox xff0c 使用如下代码添加KeyPress事件 xff0c
  • 外部启动c#窗体程序传参问题

    问题 xff1a 需要在一个软件里启动另一个独立的C 窗体软件并传入参数 xff0c 例如下面的启动语句 string language 61 34 en us 34 System Diagnostics Process Start 34
  • C#控件控制输入文本长度

    C 在控制控件输入文本的长度时要注意两个问题 xff1a 1 传递的事件参数类型要是 KeyPressEventArgs xff1b 2 对退格键 xff08 backspace xff09 做例外处理 xff0c 不然在输入到最大程度时无
  • python打印等腰三角形

    d 61 int input 39 enter an int 39 l 61 39 39 2 d 1 d 初始化列表 for i in range d l i 61 list l i 字符串转列表 x 61 i y 61 0 x 61 d
  • 7、Oracle的;与ORA-00911: invalid character

    写SQL查询 Oracle中的数据时容易遇到一个奇怪的问题 xff1a 在一般的SQL developer查询分析器中写好的SQL语句运行一切正常 xff0c 放到C 写的程序中提交 ORACLE执行就报错 错误代码如下 xff1a ORA
  • C语言变量声明加冒号的用法

    有些信息在存储时 xff0c 并不需要占用一个完整的字节 xff0c 而只需占几个或一个二进制位 例如在存放一个开关量时 xff0c 只有0和1 两种状态 xff0c 用一位二进位即可 为了节省存储空间 xff0c 并使处理简便 xff0c
  • Matlab adjust axis tick labels, limits, and tick locations

    From https cn mathworks com matlabcentral answers 92565 how do i control axis tick labels limits and axes tick locations
  • Matlab 旋转坐标轴标记文本

    在绘图中当X坐标轴标记 xff08 注意不是坐标轴名称的标签 xff09 是文本且较密集的时候我们会希望能够旋转标签以容得下所有内容 xff0c 当Y坐标轴标记是文本时 xff0c 我们也希望文本可以顺着Y轴的方向 这些都需要旋转坐标轴的标
  • Matlab - Extract values from boxplot(从箱图中获取数据)

    From http stackoverflow com questions 9728970 matlab extract values from boxplot How to extract values from built in box
  • matlab写hdf文件(含地理信息文件hdfeos)

    本文介绍matlab写hdf4和hdf5的一些方法 hdf的一些基础信息可以参考 xff1a https sanwen8 cn p 1fcFE9f html 1 matlab写hdf4文件 通常有两种方法 xff1a 1 xff09 mat

随机推荐