4]: array([0, 1, 2, 3])
In [5]: ar2
Out[5]: array([[0, 3, 5],
[2, 8, 7]])
数组的形状通过ndarray.shape给出:
In...]
Out[72]: 8
在这里,我们将row1和column1的条目设置为5:
In [75]: ar[1,1]=5; ar
Out[75]: array([[ 2, 3, 4],
[ 9,...); ar
Out[235]: array([1, 2, 3, 4])
In [238]: ar2=np.arange(5,1,-1);ar2
Out[238]: array([5, 4, 3, 2]...],[4,5,6]]); ar
Out[249]: array([[1, 2, 3],
[4, 5, 6]])
In [250]:ar.T
Out[250]:array([[1, 4],
[2,..., size=(4,4));ar
Out[320]: array([[9, 9, 4, 8],
[8, 1, 5, 3],
[6, 3, 3, 3],
[2, 1, 9, 5]])
In [318