@@ -7,6 +7,7 @@ from _typeshed import Incomplete
77from typing_extensions import deprecated
88
99from numpy import (
10+ intp ,
1011 _OrderKACF ,
1112 amax ,
1213 amin ,
@@ -465,8 +466,84 @@ class MaskedArray(ndarray[_ShapeType_co, _DType_co]):
465466 def std (self , axis = ..., dtype = ..., out = ..., ddof = ..., keepdims = ...): ...
466467 def round (self , decimals = ..., out = ...): ...
467468 def argsort (self , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., * , stable = ...): ...
468- def argmin (self , axis = ..., fill_value = ..., out = ..., * , keepdims = ...): ...
469- def argmax (self , axis = ..., fill_value = ..., out = ..., * , keepdims = ...): ...
469+
470+ # Keep in-sync with np.ma.argmin
471+ @overload
472+ def argmin ( # type: ignore[override]
473+ self ,
474+ axis : None = None ,
475+ fill_value : _ScalarLike_co | None = None ,
476+ out : None = None ,
477+ * ,
478+ keepdims : Literal [False ] | _NoValueType = ...,
479+ ) -> intp : ...
480+ @overload
481+ def argmin ( # type: ignore[override]
482+ self ,
483+ axis : SupportsIndex | None = None ,
484+ fill_value : _ScalarLike_co | None = None ,
485+ out : None = None ,
486+ * ,
487+ keepdims : bool | _NoValueType = ...,
488+ ) -> Any : ...
489+ @overload
490+ def argmin ( # type: ignore[override]
491+ self ,
492+ axis : SupportsIndex | None = None ,
493+ fill_value : _ScalarLike_co | None = None ,
494+ * ,
495+ out : _ArrayType ,
496+ keepdims : bool | _NoValueType = ...,
497+ ) -> _ArrayType : ...
498+ @overload
499+ def argmin ( # type: ignore[override]
500+ self ,
501+ axis : SupportsIndex | None ,
502+ fill_value : _ScalarLike_co | None ,
503+ out : _ArrayType ,
504+ * ,
505+ keepdims : bool | _NoValueType = ...,
506+ ) -> _ArrayType : ...
507+
508+ # Keep in-sync with np.ma.argmax
509+ @overload
510+ def argmax ( # type: ignore[override]
511+ self ,
512+ axis : None = None ,
513+ fill_value : _ScalarLike_co | None = None ,
514+ out : None = None ,
515+ * ,
516+ keepdims : Literal [False ] | _NoValueType = ...,
517+ ) -> intp : ...
518+ @overload
519+ def argmax ( # type: ignore[override]
520+ self ,
521+ axis : SupportsIndex | None = None ,
522+ fill_value : _ScalarLike_co | None = None ,
523+ out : None = None ,
524+ * ,
525+ keepdims : bool | _NoValueType = ...,
526+ ) -> Any : ...
527+ @overload
528+ def argmax ( # type: ignore[override]
529+ self ,
530+ axis : SupportsIndex | None = None ,
531+ fill_value : _ScalarLike_co | None = None ,
532+ * ,
533+ out : _ArrayType ,
534+ keepdims : bool | _NoValueType = ...,
535+ ) -> _ArrayType : ...
536+ @overload
537+ def argmax ( # type: ignore[override]
538+ self ,
539+ axis : SupportsIndex | None ,
540+ fill_value : _ScalarLike_co | None ,
541+ out : _ArrayType ,
542+ * ,
543+ keepdims : bool | _NoValueType = ...,
544+ ) -> _ArrayType : ...
545+
546+ #
470547 def sort (self , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., * , stable = ...): ...
471548 @overload
472549 def min ( # type: ignore[override]
@@ -801,8 +878,80 @@ swapaxes: _frommethod
801878trace : _frommethod
802879var : _frommethod
803880count : _frommethod
804- argmin : _frommethod
805- argmax : _frommethod
881+
882+ @overload
883+ def argmin (
884+ self : ArrayLike ,
885+ axis : None = None ,
886+ fill_value : _ScalarLike_co | None = None ,
887+ out : None = None ,
888+ * ,
889+ keepdims : Literal [False ] | _NoValueType = ...,
890+ ) -> intp : ...
891+ @overload
892+ def argmin (
893+ self : ArrayLike ,
894+ axis : SupportsIndex | None = None ,
895+ fill_value : _ScalarLike_co | None = None ,
896+ out : None = None ,
897+ * ,
898+ keepdims : bool | _NoValueType = ...,
899+ ) -> Any : ...
900+ @overload
901+ def argmin (
902+ self : ArrayLike ,
903+ axis : SupportsIndex | None = None ,
904+ fill_value : _ScalarLike_co | None = None ,
905+ * ,
906+ out : _ArrayType ,
907+ keepdims : bool | _NoValueType = ...,
908+ ) -> _ArrayType : ...
909+ @overload
910+ def argmin (
911+ self : ArrayLike ,
912+ axis : SupportsIndex | None ,
913+ fill_value : _ScalarLike_co | None ,
914+ out : _ArrayType ,
915+ * ,
916+ keepdims : bool | _NoValueType = ...,
917+ ) -> _ArrayType : ...
918+
919+ @overload
920+ def argmax (
921+ self : ArrayLike ,
922+ axis : None = None ,
923+ fill_value : _ScalarLike_co | None = None ,
924+ out : None = None ,
925+ * ,
926+ keepdims : Literal [False ] | _NoValueType = ...,
927+ ) -> intp : ...
928+ @overload
929+ def argmax (
930+ self : ArrayLike ,
931+ axis : SupportsIndex | None = None ,
932+ fill_value : _ScalarLike_co | None = None ,
933+ out : None = None ,
934+ * ,
935+ keepdims : bool | _NoValueType = ...,
936+ ) -> Any : ...
937+ @overload
938+ def argmax (
939+ self : ArrayLike ,
940+ axis : SupportsIndex | None = None ,
941+ fill_value : _ScalarLike_co | None = None ,
942+ * ,
943+ out : _ArrayType ,
944+ keepdims : bool | _NoValueType = ...,
945+ ) -> _ArrayType : ...
946+ @overload
947+ def argmax (
948+ self : ArrayLike ,
949+ axis : SupportsIndex | None ,
950+ fill_value : _ScalarLike_co | None ,
951+ out : _ArrayType ,
952+ * ,
953+ keepdims : bool | _NoValueType = ...,
954+ ) -> _ArrayType : ...
806955
807956minimum : _extrema_operation
808957maximum : _extrema_operation
0 commit comments