序  号

方    法

说    明

1

array(object[, dtype, copy, order, subok, ndmin])

创建一个数组

2

asarray(a[, dtype, order])

将输入转换为数组

3

copy(a[, order])

返回给定对象的数组副本

4

fromstring(string[, dtype, count, sep])

从字符串中的文本数据初始化的新一维数组

5

loadtxt(fname[, dtype, comments, delimiter, …])

从文本文件加载数据

6

empty(shape[, dtype, order])

返回给定形状和类型的新数组,而无需初始化条目

7

empty_like(prototype[, dtype, order, subok, …])

返回形状和类型与给定数组相同的新数组

8

eye(N[, M, k, dtype, order])

返回一个二维数组,对角线上有一个,其他地方为零

9

identity(n[, dtype])

返回标识数组

10

ones(shape[, dtype, order])

返回给定形状和类型的新数组,并填充为 1

11

ones_like(a[, dtype, order, subok, shape])

返回形状与类型与给定数组相同的数组

12

zeros(shape[, dtype, order])

返回给定形状和类型的新数组,并用零填充

13

zeros_like(a[, dtype, order, subok, shape])

返回形状与类型与给定数组相同的零数组。

14

full(shape, fill_value[, dtype, order])

返回给定形状和类型的新数组,并用 fill_value 填充

15

full_like(a, fill_value[, dtype, order, …])

返回形状和类型与给定数组相同的完整数组

16

diag(v[, k])

提取对角线或构造对角线数组

17

diagflat(v[, k])

使用展平的输入作为对角线创建二维数组

18

tri(N[, M, k, dtype])

在给定对角线处及以下且在其他位置为零的数组

19

tril(m[, k])

数组的下三角

20

triu(m[, k])

数组的上三角

21

copyto(dst, src[, casting, where])

将值从一个数组复制到另一个数组,并根据需要进行广播

22

reshape(a, newshape[, order])

在不更改数据的情况下为数组赋予新的形状。

23

ravel(a[, order])

返回一个连续的扁平数组。

24

rollaxis(a, axis[, start])

向后滚动指定的轴,直到其位于给定的位置。

25

swapaxes(a, axis1, axis2)

互换数组的两个轴。

26

ndarray.T

转置数组。

27

transpose(a[, axes])

排列数组的尺寸

28

concatenate((a1, a2, …)

沿现有轴连接一系列数组。

29

stack(arrays[, axis, out])

沿新轴连接一系列数组。

30

column_stack(tup)

将一维数组作为列堆叠到二维数组中。

31

dstack(tup)

沿深度方向( 沿第三轴)按顺序堆叠数组。

32

hstack(tup)

水平( 按列)顺序堆叠数组。

33

vstack(tup)

垂直( 行)按顺序堆叠数组。

34

block(arrays)

从块的嵌套列表中组装一个 nd 数组。

35

split(ary, indices_or_sections[, axis])

将数组拆分为多个子数组,作为 ary 的视图。

36

array_split(ary, indices_or_sections[, axis])

将一个数组拆分为多个子数组。

37

dsplit(ary, indices_or_sections)

沿第 3 轴( 深度)将数组拆分为多个子数组。

38

hsplit(ary, indices_or_sections)

水平( 按列)将一个数组拆分为多个子数组。

39

vsplit(ary, indices_or_sections)

垂直( 行)将数组拆分为多个子数组。

40

delete(arr, obj[, axis])

返回一个新的数组,该数组具有沿删除的轴的子数组。

41

insert(arr, obj, values[, axis])

沿给定轴在给定索引之前插入值。

42

append(arr, values[, axis])

将值附加到数组的末尾。

43

resize(a, new_shape)

返回具有指定形状的新数组。

44

trim_zeross(filt[, trim])

修剪一维数组或序列中的前导和 / 或尾随零。

45

unique(ar[, return_index, return_inverse, …])

查找数组的唯一元素。

46

flip(m[, axis])

沿给定轴颠倒数组中元素的顺序。

47

fliplr(m)

左右翻转数组。

48

flipud(m)

上下翻转阵列。

49

reshape(a, newshape[, order])

在不更改数据的情况下为数组赋予新的形状。

50

roll(a, shift[, axis])

沿给定轴滚动数组元素。

51

rot90(m[, k, axes])

在轴指定的平面中将阵列旋转 90 度。