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

Method A

numpy/matrixlib/defmatrix.py:839–866  ·  view source on GitHub ↗

Return `self` as an `ndarray` object. Equivalent to ``np.asarray(self)``. Parameters ---------- None Returns ------- ret : ndarray `self` as an `ndarray` Examples -------- >>> x = np.matrix(np.ar

(self)

Source from the content-addressed store, hash-verified

837
838 @property
839 def A(self):
840 """
841 Return `self` as an `ndarray` object.
842
843 Equivalent to ``np.asarray(self)``.
844
845 Parameters
846 ----------
847 None
848
849 Returns
850 -------
851 ret : ndarray
852 `self` as an `ndarray`
853
854 Examples
855 --------
856 >>> x = np.matrix(np.arange(12).reshape((3,4))); x
857 matrix([[ 0, 1, 2, 3],
858 [ 4, 5, 6, 7],
859 [ 8, 9, 10, 11]])
860 >>> x.getA()
861 array([[ 0, 1, 2, 3],
862 [ 4, 5, 6, 7],
863 [ 8, 9, 10, 11]])
864
865 """
866 return self.__array__()
867
868 @property
869 def A1(self):

Callers 1

test_frompyfunc_leaksMethod · 0.80

Calls 1

__array__Method · 0.45

Tested by 1

test_frompyfunc_leaksMethod · 0.64