Previous topic

numpy.ndarray

Next topic

numpy.ndarray.data

This is documentation for an old release of NumPy (version 1.13). 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.])