Skip to content

Commit e3cd51a

Browse files
committed
Added type hints to Index.repeat, Index.argmin and Index.argmax
1 parent 61e54c2 commit e3cd51a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pandas/core/indexes/base.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
ArrayLike,
5050
Axes,
5151
Axis,
52+
AxisInt,
5253
DropKeep,
5354
DtypeObj,
5455
F,
@@ -1205,7 +1206,7 @@ def _maybe_disallow_fill(self, allow_fill: bool, fill_value, indices) -> bool:
12051206
"""
12061207

12071208
@Appender(_index_shared_docs["repeat"] % _index_doc_kwargs)
1208-
def repeat(self, repeats, axis=None):
1209+
def repeat(self, repeats, axis: AxisInt | None = None):
12091210
repeats = ensure_platform_int(repeats)
12101211
nv.validate_repeat((), {"axis": axis})
12111212
res_values = self._values.repeat(repeats)
@@ -7272,7 +7273,9 @@ def _maybe_disable_logical_methods(self, opname: str_t) -> None:
72727273
make_invalid_op(opname)(self)
72737274

72747275
@Appender(IndexOpsMixin.argmin.__doc__)
7275-
def argmin(self, axis=None, skipna: bool = True, *args, **kwargs) -> int:
7276+
def argmin(
7277+
self, axis: AxisInt | None = None, skipna: bool = True, *args, **kwargs
7278+
) -> int:
72767279
nv.validate_argmin(args, kwargs)
72777280
nv.validate_minmax_axis(axis)
72787281

@@ -7291,7 +7294,9 @@ def argmin(self, axis=None, skipna: bool = True, *args, **kwargs) -> int:
72917294
return super().argmin(skipna=skipna)
72927295

72937296
@Appender(IndexOpsMixin.argmax.__doc__)
7294-
def argmax(self, axis=None, skipna: bool = True, *args, **kwargs) -> int:
7297+
def argmax(
7298+
self, axis: AxisInt | None = None, skipna: bool = True, *args, **kwargs
7299+
) -> int:
72957300
nv.validate_argmax(args, kwargs)
72967301
nv.validate_minmax_axis(axis)
72977302

0 commit comments

Comments
 (0)