Previous topic

numpy.ndarray.dtype

Next topic

numpy.ndarray.real

This is documentation for an old release of NumPy (version 1.15). Read this page in the documentation of the latest stable release (version 2.2).

numpy.ndarray.T

ndarray.T

Same as self.transpose(), except that self is returned if self.ndim < 2.

Examples

>>>
>>> x = np.array([[1.,2.],[3.,4.]])
>>> x
array([[ 1.,  2.],
       [ 3.,  4.]])
>>> x.T
array([[ 1.,  3.],
       [ 2.,  4.]])
>>> x = np.array([1.,2.,3.,4.])
>>> x
array([ 1.,  2.,  3.,  4.])
>>> x.T
array([ 1.,  2.,  3.,  4.])