常用 API
本章按功能分组介绍了各常用的API。许多的API包含示例代码,这些示例代码演示了API的基本用法。
这些示例都是使用NumPy并且是通过这种方式导入NumPy:
>>> import numpy as np
::: tip 提示
执行示例的一种便捷的方法是 IPython 的 %doctest_mode 模式,它允许粘贴多行示例并保留缩进。
:::
- 创建数组
- Ones and zeros
- From existing data
- Creating record arrays (numpy.rec)
- Creating character arrays (numpy.char)
- Numerical ranges
- Building matrices
- The Matrix class
- 数组操作
- Basic operations
- Changing array shape
- Transpose-like operations
- Changing number of dimensions
- Changing kind of array
- Joining arrays
- Splitting arrays
- Tiling arrays
- Adding and removing elements
- Rearranging elements
- 二进制操作
- Elementwise bit operations
- Bit packing
- Output formatting
- 字符串操作
- String operations
- Comparison
- String information
- Convenience class
- C-Types外部函数接口(numpy.ctypeslib)
- 时间日期相关
- numpy.datetime_as_string
- numpy.datetime_data
- Business Day Functions
- 数据类型相关
- numpy.can_cast
- numpy.promote_types
- numpy.min_scalar_type
- numpy.result_type
- numpy.common_type
- numpy.obj2sctype
- Creating data types
- Data type information
- Data type testing
- Miscellaneous
- 可选的Scipy加速支持(numpy.dual)
- Linear algebra
- FFT
- Other
- 具有自动域的数学函数(numpy.emath)
- 浮点错误处理
- Setting and getting error handling
- Internal functions
- 离散傅立叶变换(numpy.fft)
- Standard FFTs
- Real FFTs
- Hermitian FFTs
- Helper routines
- Background information
- Implementation details
- Normalization
- Real and Hermitian transforms
- Higher dimensions
- References
- Examples
- 财金相关
- Simple financial functions
- 实用的功能
- numpy.apply_along_axis
- numpy.apply_over_axes
- numpy.vectorize
- numpy.frompyfunc
- numpy.piecewise
- 特殊的NumPy帮助功能
- Finding help
- Reading help
- 索引相关
- Generating index arrays
- Indexing-like operations
- Inserting data into arrays
- Iterating over arrays
- 输入和输出
- NumPy binary files (NPY, NPZ)
- Text files
- Raw binary files
- String formatting
- Memory mapping files
- Text formatting options
- Base-n representations
- Data sources
- Binary Format Description
- 线性代数(numpy.linalg)
- Matrix and vector products
- Decompositions
- Matrix eigenvalues
- Norms and other numbers
- Solving equations and inverting matrices
- Exceptions
- Linear algebra on several matrices at once
- 逻辑函数
- Truth value testing
- Array contents
- Array type testing
- Logical operations
- Comparison
- 操作掩码数组
- Constants
- Creation
- Inspecting the array
- Manipulating a MaskedArray
- Operations on masks
- Conversion operations
- Masked arrays arithmetics
- 数学函数
- Trigonometric functions
- Hyperbolic functions
- Rounding
- Sums, products, differences
- Exponents and logarithms
- Other special functions
- Floating point routines
- Rational routines
- Arithmetic operations
- Handling complex numbers
- Miscellaneous
- 矩阵库(numpy.matlib)
- numpy.matlib.empty
- numpy.matlib.zeros
- numpy.matlib.ones
- numpy.matlib.eye
- numpy.matlib.identity
- numpy.matlib.repmat
- numpy.matlib.rand
- numpy.matlib.randn
- 杂项
- Performance tuning
- Memory ranges
- Array mixins
- NumPy version comparison
- Utility
- Matlab-like Functions
- 填充数组
- numpy.pad
- 多项式
- Transition notice
- 随机抽样(numpy.random)
- Quick Start
- Introduction
- Concepts
- Features
- 集合操作
- Making proper sets
- Boolean operations
- 排序、搜索和计数
- Sorting
- Searching
- Counting
- 统计相关
- Order statistics
- Averages and variances
- Correlating
- Histograms
- 测试支持(numpy.testing)
- Asserts
- Decorators
- Test Running
- Guidelines
- 窗口函数
- Various windows