本文由 大侠(AhcaoZhu)原创,转载请声明。
链接: https://blog.csdn.net/Ahcao2008
一图看懂 numpy 库结构:资料整理+笔记(大全)
【简介】全文介绍 numpy 的整体架构,包括模块、函数、类及类的方法和属性。它改变了第三版以前直接取材于原码的方式,而是采用 inspect的方法和技术,我尽可能地做到与系统的help(numpy)输出保持一致,但是在各对象类别的范围界定上,兼顾了实用和完整性。大部分doc经网络人工智能翻译 + 人工校对。是一部不可多得的权威字典类工具书。它是续集的一部分。后续陆续发布、敬请关注。【原创】 大侠Ahcao
以下来自于:zjgPyObj(numpy) ver4.0,英文为网络机器自动翻译(有道)+ 人工校对。
说明:
本文共收录:
类别 数量 constants常量 49 sys系统 18 module模块 18 class类 97(类的方法、属性将在分结构中展开) function函数 272 builtins内嵌 23 other其它 113(不太重要或能用的继承) residual特定 24 total合计 604(仅一、二级目录)三级目录43K行,另文给出。
constants
0001 int ERR_WARN 1
0002 int FPE_UNDERFLOW 4
0003 int ERR_PRINT 4
0004 int ERR_LOG 5
0005 int ERR_CALL 3
0006 int SHIFT_INVALID 9
0007 int UFUNC_BUFSIZE_DEFAULT 8192
0008 int tracemalloc_domain 389047
0009 int MAY_SHARE_BOUNDS 0
0010 int ERR_RAISE 2
0011 int use_hugepage 1
0012 int FPE_DIVIDEBYZERO 1
0013 int SHIFT_UNDERFLOW 6
0014 int ERR_DEFAULT 521
0015 int RAISE 2
0016 int BUFSIZE 8192
0017 int CLIP 0
0018 int ALLOW_THREADS 1
0019 int FPE_INVALID 8
0020 int WRAP 1
0021 int SHIFT_OVERFLOW 3
0022 int MAY_SHARE_EXACT -1
0023 int FPE_OVERFLOW 2
0024 int ERR_IGNORE 0
0025 int MAXDIMS 32
0026 int FLOATING_POINT_SUPPORT 1
0027 int SHIFT_DIVIDEBYZERO 0
0028 bool little_endian True
0029 float inf inf
0030 float nan nan
0031 float NINF -inf
0032 float PINF inf
0033 float pi 3.141592653589793
0034 float NAN nan
0035 float PZERO 0.0
0036 float NaN nan
0037 float Infinity inf
0038 float e 2.718281828459045
0039 float euler_gamma 0.5772156649015329
0040 float NZERO -0.0
0041 float Inf inf
0042 float infty inf
0043 str oldnumeric removed
0044 str numarray removed
0045 str UFUNC_PYVALS_NAME UFUNC_PYVALS
0046 tuple ScalarType (<class 'int'>, <class 'float'>,...)
0047 dict sctypeDict {'?': <class 'numpy.bool_'>, 0: <class 'numpy.bool_'>,...}
0048 dict sctypes {'int': [<class 'numpy.int8'>, <class 'numpy.int16'>, ...}
sys
0050 str __name__ numpy
0051 str __doc__ ...
0052 str __package__ numpy
0053 SourceFileLoader __loader__ <_frozen_importlib_external.SourceFileLoader object at 0x00000000038F2088>
0054 ModuleSpec __spec__ ModuleSpec(name='numpy', loader=<...>, origin='...\\__init__.py', submodule_search_locations=['...\\numpy'])
0055 list __path__ ['〖pyLibpath〗\\site-packages\\numpy']
0056 str __file__ 〖pyLibpath〗\site-packages\numpy\__init__.py
0057 str __cached__ 〖pyLibpath〗\site-packages\numpy\__pycache__\__init__.cpython-37.pyc
0058 dict __builtins__ {...}
0059 bool __NUMPY_SETUP__ False
0060 module __config__ <module 'numpy.__config__' from '〖pyLibpath〗\\site-packages\\numpy\\__config__.py'>
0061 list __all__ ['ModuleDeprecationWarning', 'VisibleDeprecationWarning', ...]
0062 str __version__ 1.21.6
0063 str __git_version__ ef0ec786fd4c7622ad2fa0e54d3881f3b9bbd792
0064 dict __deprecated_attrs__ {'object': (<class 'object'>,...}
0065 dict __expired_functions__ {'fv': '...', ...}
0066 function __getattr__ <function __getattr__ at 0x00000000038D1798>
0067 function __dir__ <function __dir__ at 0x000000000A3D1B88>
module
0068 module char <module 'numpy.core.defchararray' from '〖pyLibpath〗\\site-packages\\numpy\\core\\defchararray.py'>
0069 module compat <module 'numpy.compat' from '〖pyLibpath〗\\site-packages\\numpy\\compat\\__init__.py'>
0070 module core <module 'numpy.core' from '〖pyLibpath〗\\site-packages\\numpy\\core\\__init__.py'>
0071 module ctypeslib <module 'numpy.ctypeslib' from '〖pyLibpath〗\\site-packages\\numpy\\ctypeslib.py'>
0072 module emath <module 'numpy.lib.scimath' from '〖pyLibpath〗\\site-packages\\numpy\\lib\\scimath.py'>
0073 module fft <module 'numpy.fft' from '〖pyLibpath〗\\site-packages\\numpy\\fft\\__init__.py'>
0074 module lib <module 'numpy.lib' from '〖pyLibpath〗\\site-packages\\numpy\\lib\\__init__.py'>
0075 module linalg <module 'numpy.linalg' from '〖pyLibpath〗\\site-packages\\numpy\\linalg\\__init__.py'>
0076 module ma <module 'numpy.ma' from '〖pyLibpath〗\\site-packages\\numpy\\ma\\__init__.py'>
0077 module math <module 'math' (built-in)>
0078 module matrixlib <module 'numpy.matrixlib' from '〖pyLibpath〗\\site-packages\\numpy\\matrixlib\\__init__.py'>
0079 module os <module 'os' from '〖pyLibpath〗\\os.py'>
0080 module polynomial <module 'numpy.polynomial' from '〖pyLibpath〗\\site-packages\\numpy\\polynomial\\__init__.py'>
0081 module random <module 'numpy.random' from '〖pyLibpath〗\\site-packages\\numpy\\random\\__init__.py'>
0082 module rec <module 'numpy.core.records' from '〖pyLibpath〗\\site-packages\\numpy\\core\\records.py'>
0083 module sys <module 'sys' (built-in)>
0084 module version <module 'numpy.version' from '〖pyLibpath〗\\site-packages\\numpy\\version.py'>
0085 module warnings <module 'warnings' from '〖pyLibpath〗\\warnings.py'>
class
0086 type AxisError <class 'numpy.AxisError'>
0087 type Bytes0 <class 'numpy.bytes_'>
0088 type ComplexWarning <class 'numpy.ComplexWarning'>
0089 type DataSource <class 'numpy.DataSource'>
0090 type Datetime64 <class 'numpy.datetime64'>
0091 type MachAr <class 'numpy.MachAr'>
0092 type ModuleDeprecationWarning <class 'numpy.ModuleDeprecationWarning'>
0093 type RankWarning <class 'numpy.RankWarning'>
0094 type Str0 <class 'numpy.str_'>
0095 type TooHardError <class 'numpy.TooHardError'>
0096 type Uint64 <class 'numpy.uint64'>
0097 type VisibleDeprecationWarning <class 'numpy.VisibleDeprecationWarning'>
0098 type bool8 <class 'numpy.bool_'>
0099 type bool_ <class 'numpy.bool_'>
0100 type broadcast <class 'numpy.broadcast'>
0101 type busdaycalendar <class 'numpy.busdaycalendar'>
0102 type byte <class 'numpy.int8'>
0103 type bytes0 <class 'numpy.bytes_'>
0104 type bytes_ <class 'numpy.bytes_'>
0105 type cdouble <class 'numpy.complex128'>
0106 type cfloat <class 'numpy.complex128'>
0107 type character <class 'numpy.character'>
0108 type chararray <class 'numpy.chararray'>
0109 type clongdouble <class 'numpy.clongdouble'>
0110 type clongfloat <class 'numpy.clongdouble'>
0111 type complex128 <class 'numpy.complex128'>
0112 type complex64 <class 'numpy.complex64'>
0113 type complex_ <class 'numpy.complex128'>
0114 type complexfloating <class 'numpy.complexfloating'>
0115 type csingle <class 'numpy.complex64'>
0116 type datetime64 <class 'numpy.datetime64'>
0117 type double <class 'numpy.float64'>
0118 _DTypeMeta dtype <class 'numpy.dtype'>
0119 type errstate <class 'numpy.errstate'>
0120 type finfo <class 'numpy.finfo'>
0121 type flatiter <class 'numpy.flat