>>> a
array([[1, 2],
[3, 4]])
>>> a.shape
(2, 2)
>>> b
array([2, 3])
>>> b.shape
(2,)
>>> c
array([[1],
[2]])
>>> c.shape
(2, 1)
>>> d
array([[1, 2]])
>>> d.shape
(1, 2)
>>> d.sum(0)==e
array([ True, True], dtype=bool)
>>> e
array([1, 2])
numpy ndarray
时间: 2024-11-08 20:09:25