summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2021-04-23 14:38:56 +0200
committerBas van Beek <b.f.van.beek@vu.nl>2021-04-23 14:39:41 +0200
commit0388434a18de5dc02e0438a49e31dde44a59fe2b (patch)
treef77eb306c6e1bcb6b33dcc14b98595478880495b /numpy
parent4f1390e9d31edda13890e230d23dc1651310050a (diff)
downloadnumpy-0388434a18de5dc02e0438a49e31dde44a59fe2b.tar.gz
ENH: Add improved placeholder annotations for `np.matrixlib`
Diffstat (limited to 'numpy')
-rw-r--r--numpy/__init__.pyi40
-rw-r--r--numpy/matrixlib/__init__.pyi11
2 files changed, 46 insertions, 5 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi
index b0cfa6a0a..6899343c0 100644
--- a/numpy/__init__.pyi
+++ b/numpy/__init__.pyi
@@ -475,7 +475,45 @@ class matrix(ndarray[_ShapeType, _DType_co]):
dtype: Any = ...,
copy: Any = ...,
) -> Any: ...
- def __getattr__(self, key: str) -> Any: ...
+ def __array_finalize__(self, obj): ...
+ def __getitem__(self, index): ...
+ def __mul__(self, other): ...
+ def __rmul__(self, other): ...
+ def __imul__(self, other): ...
+ def __pow__(self, other): ...
+ def __ipow__(self, other): ...
+ def __rpow__(self, other): ...
+ def tolist(self): ...
+ def sum(self, axis=..., dtype=..., out=...): ...
+ def squeeze(self, axis=...): ...
+ def flatten(self, order=...): ...
+ def mean(self, axis=..., dtype=..., out=...): ...
+ def std(self, axis=..., dtype=..., out=..., ddof=...): ...
+ def var(self, axis=..., dtype=..., out=..., ddof=...): ...
+ def prod(self, axis=..., dtype=..., out=...): ...
+ def any(self, axis=..., out=...): ...
+ def all(self, axis=..., out=...): ...
+ def max(self, axis=..., out=...): ...
+ def argmax(self, axis=..., out=...): ...
+ def min(self, axis=..., out=...): ...
+ def argmin(self, axis=..., out=...): ...
+ def ptp(self, axis=..., out=...): ...
+ def ravel(self, order=...): ...
+ @property
+ def T(self): ...
+ @property
+ def I(self): ...
+ @property
+ def A(self): ...
+ @property
+ def A1(self): ...
+ @property
+ def H(self): ...
+ def getT(self): ...
+ def getA(self): ...
+ def getA1(self): ...
+ def getH(self): ...
+ def getI(self): ...
class memmap(ndarray[_ShapeType, _DType_co]):
def __new__(
diff --git a/numpy/matrixlib/__init__.pyi b/numpy/matrixlib/__init__.pyi
index b9005c4aa..e4b5c19a2 100644
--- a/numpy/matrixlib/__init__.pyi
+++ b/numpy/matrixlib/__init__.pyi
@@ -1,8 +1,11 @@
from typing import Any, List
+from numpy import (
+ matrix as matrix,
+)
+
__all__: List[str]
-matrix: Any
-bmat: Any
-mat: Any
-asmatrix: Any
+def bmat(obj, ldict=..., gdict=...): ...
+def asmatrix(data, dtype=...): ...
+mat = asmatrix