MCPcopy Create free account
hub / github.com/numpy/numpy / A1

Method A1

numpy/matrixlib/defmatrix.py:869–895  ·  view source on GitHub ↗

Return `self` as a flattened `ndarray`. Equivalent to ``np.asarray(x).ravel()`` Parameters ---------- None Returns ------- ret : ndarray `self`, 1-D, as an `ndarray` Examples -------- >>> x = np.

(self)

Source from the content-addressed store, hash-verified

867
868 @property
869 def A1(self):
870 """
871 Return `self` as a flattened `ndarray`.
872
873 Equivalent to ``np.asarray(x).ravel()``
874
875 Parameters
876 ----------
877 None
878
879 Returns
880 -------
881 ret : ndarray
882 `self`, 1-D, as an `ndarray`
883
884 Examples
885 --------
886 >>> x = np.matrix(np.arange(12).reshape((3,4))); x
887 matrix([[ 0, 1, 2, 3],
888 [ 4, 5, 6, 7],
889 [ 8, 9, 10, 11]])
890 >>> x.getA1()
891 array([ 0, 1, 2, ..., 9, 10, 11])
892
893
894 """
895 return self.__array__().ravel()
896
897
898 def ravel(self, order='C'):

Callers

nothing calls this directly

Calls 2

ravelMethod · 0.45
__array__Method · 0.45

Tested by

no test coverage detected