Numpy _ base _ 1, numpy base _ 1
Ndarray: multidimensional array
Ndarray each array element must be of the same type, and each array has a shape and dtype object.
Shape indicates the array size.
Dtype indicates the array data type
Array
How to create an array?
In [1]: import numpy as np
In [2]: data = [1, 2, 3, 4, 5, 6, 7]
In [3]: arr = np. array (data)
In [3]: arr
Out [3]: array ([1, 2, 3, 4, 5, 6, 7])
View array size
Arr. shape
View array data types
Arr. dtype
Asarray
Np. asarray (1, 2, 3, 4, 5, 6, 7)
Arange
Np. arange (10)
Ones
Create an array full of 1
Ones_like
Zeros
Create a zero-dimensional array
2-Dimension
Create a two-dimensional array with all values 0
Dimension 3
Create a 3D array with all values 0
Empty
Enter the memory spam value, but do not fill the value
Empty_lile
Input an array to create an array full of 1
Eye
Create an N * N Array with a diagonal line of 1 and other values of 0
Identity
Create an N * N Array with a diagonal line of 1 and other values of 0