diff --git a/pandas-stubs/_typing.pyi b/pandas-stubs/_typing.pyi index 935d43470..868642796 100644 --- a/pandas-stubs/_typing.pyi +++ b/pandas-stubs/_typing.pyi @@ -198,8 +198,6 @@ class WriteExcelBuffer(WriteBuffer[bytes], Protocol): FilePath: TypeAlias = str | PathLike[str] -AxisInt: TypeAlias = Literal[0, 1] -Axis: TypeAlias = AxisInt | Literal["index", "columns", "rows"] IndexLabel: TypeAlias = Hashable | Sequence[Hashable] Label: TypeAlias = Hashable | None Level: TypeAlias = Hashable | int @@ -229,12 +227,9 @@ AggFuncTypeFrame: TypeAlias = ( ) num: TypeAlias = complex -SeriesAxisType: TypeAlias = Literal[ - "index", 0 -] # Restricted subset of _AxisType for series -AxisTypeIndex: TypeAlias = Literal["index", 0] -AxisTypeColumn: TypeAlias = Literal["columns", 1] -AxisType: TypeAlias = AxisTypeIndex | AxisTypeColumn +AxisIndex: TypeAlias = Literal["index", 0] +AxisColumn: TypeAlias = Literal["columns", 1] +Axis: TypeAlias = AxisIndex | AxisColumn DtypeNp = TypeVar("DtypeNp", bound=np.dtype[np.generic]) KeysArgType: TypeAlias = Any ListLike = TypeVar("ListLike", Sequence, np.ndarray, "Series", "Index") diff --git a/pandas-stubs/core/algorithms.pyi b/pandas-stubs/core/algorithms.pyi index ec17cc925..a2e0dab1c 100644 --- a/pandas-stubs/core/algorithms.pyi +++ b/pandas-stubs/core/algorithms.pyi @@ -1,5 +1,8 @@ from collections.abc import Sequence -from typing import overload +from typing import ( + Literal, + overload, +) import numpy as np from pandas import ( @@ -14,7 +17,6 @@ from pandas.api.extensions import ExtensionArray from pandas._typing import ( AnyArrayLike, - AxisInt, IntervalT, TakeIndexer, ) @@ -74,7 +76,7 @@ def value_counts( def take( arr, indices: TakeIndexer, - axis: AxisInt = 0, + axis: Literal[0, 1] = 0, allow_fill: bool = False, fill_value=None, ): ... diff --git a/pandas-stubs/core/base.pyi b/pandas-stubs/core/base.pyi index 1d1902ae8..20fd074a8 100644 --- a/pandas-stubs/core/base.pyi +++ b/pandas-stubs/core/base.pyi @@ -11,10 +11,10 @@ from pandas.core.arrays import ExtensionArray from pandas.core.arrays.categorical import Categorical from pandas._typing import ( + AxisIndex, NaPosition, NDFrameT, Scalar, - SeriesAxisType, npt, ) @@ -56,10 +56,10 @@ class IndexOpsMixin(OpsMixin): def max(self, axis=..., skipna: bool = ..., **kwargs): ... def min(self, axis=..., skipna: bool = ..., **kwargs): ... def argmax( - self, axis: SeriesAxisType | None = ..., skipna: bool = ..., *args, **kwargs + self, axis: AxisIndex | None = ..., skipna: bool = ..., *args, **kwargs ) -> np.ndarray: ... def argmin( - self, axis: SeriesAxisType | None = ..., skipna: bool = ..., *args, **kwargs + self, axis: AxisIndex | None = ..., skipna: bool = ..., *args, **kwargs ) -> np.ndarray: ... def tolist(self) -> list: ... def to_list(self) -> list: ... diff --git a/pandas-stubs/core/frame.pyi b/pandas-stubs/core/frame.pyi index 5cf47ede9..5f7354578 100644 --- a/pandas-stubs/core/frame.pyi +++ b/pandas-stubs/core/frame.pyi @@ -62,9 +62,8 @@ from pandas._typing import ( AstypeArg, Axes, Axis, - AxisType, - AxisTypeColumn, - AxisTypeIndex, + AxisColumn, + AxisIndex, CalculationMethod, ColspaceArgType, CompressionOptions, @@ -101,7 +100,6 @@ from pandas._typing import ( ReplaceMethod, Scalar, ScalarT, - SeriesAxisType, SortKind, StataDateFormat, StorageOptions, @@ -552,21 +550,21 @@ class DataFrame(NDFrame, OpsMixin): self, other: DataFrame | Series, join: JoinHow = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., copy: _bool = ..., fill_value=..., method: FillnaOptions | None = ..., limit: int | None = ..., - fill_axis: AxisType = ..., - broadcast_axis: AxisType | None = ..., + fill_axis: Axis = ..., + broadcast_axis: Axis | None = ..., ) -> DataFrame: ... def reindex( self, labels: Axes | None = ..., index: Axes | None = ..., columns: Axes | None = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., method: FillnaOptions | Literal["nearest"] | None = ..., copy: bool = ..., level: int | _str = ..., @@ -655,7 +653,7 @@ class DataFrame(NDFrame, OpsMixin): value: Scalar | NAType | dict | Series | DataFrame | None = ..., *, method: FillnaOptions | None = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., limit: int = ..., downcast: dict | None = ..., inplace: Literal[True], @@ -666,7 +664,7 @@ class DataFrame(NDFrame, OpsMixin): value: Scalar | NAType | dict | Series | DataFrame | None = ..., *, method: FillnaOptions | None = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., limit: int = ..., downcast: dict | None = ..., inplace: Literal[False] = ..., @@ -677,7 +675,7 @@ class DataFrame(NDFrame, OpsMixin): value: Scalar | NAType | dict | Series | DataFrame | None = ..., *, method: FillnaOptions | None = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., inplace: _bool | None = ..., limit: int = ..., downcast: dict | None = ..., @@ -719,7 +717,7 @@ class DataFrame(NDFrame, OpsMixin): self, periods: int = ..., freq=..., - axis: AxisType = ..., + axis: Axis = ..., fill_value: Hashable | None = ..., ) -> DataFrame: ... @overload @@ -796,7 +794,7 @@ class DataFrame(NDFrame, OpsMixin): def dropna( self, *, - axis: AxisType = ..., + axis: Axis = ..., how: Literal["any", "all"] = ..., thresh: int | None = ..., subset: ListLikeU | Scalar | None = ..., @@ -806,7 +804,7 @@ class DataFrame(NDFrame, OpsMixin): def dropna( self, *, - axis: AxisType = ..., + axis: Axis = ..., how: Literal["any", "all"] = ..., thresh: int | None = ..., subset: ListLikeU | Scalar | None = ..., @@ -816,7 +814,7 @@ class DataFrame(NDFrame, OpsMixin): def dropna( self, *, - axis: AxisType = ..., + axis: Axis = ..., how: Literal["any", "all"] = ..., thresh: int | None = ..., subset: ListLikeU | Scalar | None = ..., @@ -840,7 +838,7 @@ class DataFrame(NDFrame, OpsMixin): self, by: _str | Sequence[_str], *, - axis: AxisType = ..., + axis: Axis = ..., ascending: _bool | Sequence[_bool] = ..., kind: SortKind = ..., na_position: NaPosition = ..., @@ -853,7 +851,7 @@ class DataFrame(NDFrame, OpsMixin): self, by: _str | Sequence[_str], *, - axis: AxisType = ..., + axis: Axis = ..., ascending: _bool | Sequence[_bool] = ..., kind: SortKind = ..., na_position: NaPosition = ..., @@ -866,7 +864,7 @@ class DataFrame(NDFrame, OpsMixin): self, by: _str | Sequence[_str], *, - axis: AxisType = ..., + axis: Axis = ..., ascending: _bool | Sequence[_bool] = ..., inplace: _bool | None = ..., kind: SortKind = ..., @@ -878,7 +876,7 @@ class DataFrame(NDFrame, OpsMixin): def sort_index( self, *, - axis: AxisType = ..., + axis: Axis = ..., level: Level | None = ..., ascending: _bool | Sequence[_bool] = ..., kind: SortKind = ..., @@ -892,7 +890,7 @@ class DataFrame(NDFrame, OpsMixin): def sort_index( self, *, - axis: AxisType = ..., + axis: Axis = ..., level: Level | list[int] | list[_str] | None = ..., ascending: _bool | Sequence[_bool] = ..., kind: SortKind = ..., @@ -906,7 +904,7 @@ class DataFrame(NDFrame, OpsMixin): def sort_index( self, *, - axis: AxisType = ..., + axis: Axis = ..., level: Level | list[int] | list[_str] | None = ..., ascending: _bool | Sequence[_bool] = ..., inplace: _bool | None = ..., @@ -937,9 +935,9 @@ class DataFrame(NDFrame, OpsMixin): keep: NaPosition | Literal["all"] = ..., ) -> DataFrame: ... def swaplevel( - self, i: Level = ..., j: Level = ..., axis: AxisType = ... + self, i: Level = ..., j: Level = ..., axis: Axis = ... ) -> DataFrame: ... - def reorder_levels(self, order: list, axis: AxisType = ...) -> DataFrame: ... + def reorder_levels(self, order: list, axis: Axis = ...) -> DataFrame: ... def compare( self, other: DataFrame, @@ -968,7 +966,7 @@ class DataFrame(NDFrame, OpsMixin): def groupby( self, by: Scalar, - axis: AxisType = ..., + axis: Axis = ..., level: Level | None = ..., as_index: _bool = ..., sort: _bool = ..., @@ -981,7 +979,7 @@ class DataFrame(NDFrame, OpsMixin): def groupby( self, by: GroupByObjectNonScalar | None = ..., - axis: AxisType = ..., + axis: Axis = ..., level: Level | None = ..., as_index: _bool = ..., sort: _bool = ..., @@ -1029,31 +1027,31 @@ class DataFrame(NDFrame, OpsMixin): col_level: int | _str | None = ..., ignore_index: _bool = ..., ) -> DataFrame: ... - def diff(self, periods: int = ..., axis: AxisType = ...) -> DataFrame: ... + def diff(self, periods: int = ..., axis: Axis = ...) -> DataFrame: ... @overload - def agg(self, func: AggFuncTypeBase, axis: AxisType = ..., **kwargs) -> Series: ... + def agg(self, func: AggFuncTypeBase, axis: Axis = ..., **kwargs) -> Series: ... @overload def agg( self, func: list[AggFuncTypeBase] | AggFuncTypeDictFrame = ..., - axis: AxisType = ..., + axis: Axis = ..., **kwargs, ) -> DataFrame: ... @overload def aggregate( - self, func: AggFuncTypeBase, axis: AxisType = ..., **kwargs + self, func: AggFuncTypeBase, axis: Axis = ..., **kwargs ) -> Series: ... @overload def aggregate( self, func: list[AggFuncTypeBase] | AggFuncTypeDictFrame, - axis: AxisType = ..., + axis: Axis = ..., **kwargs, ) -> DataFrame: ... def transform( self, func: AggFuncTypeFrame, - axis: AxisType = ..., + axis: Axis = ..., *args, **kwargs, ) -> DataFrame: ... @@ -1063,7 +1061,7 @@ class DataFrame(NDFrame, OpsMixin): def apply( self, f: Callable[..., ListLikeExceptSeriesAndStr | Series], - axis: AxisTypeIndex = ..., + axis: AxisIndex = ..., raw: _bool = ..., result_type: None = ..., args=..., @@ -1073,7 +1071,7 @@ class DataFrame(NDFrame, OpsMixin): def apply( self, f: Callable[..., S1], - axis: AxisTypeIndex = ..., + axis: AxisIndex = ..., raw: _bool = ..., result_type: None = ..., args=..., @@ -1085,7 +1083,7 @@ class DataFrame(NDFrame, OpsMixin): def apply( self, f: Callable[..., Mapping], - axis: AxisTypeIndex = ..., + axis: AxisIndex = ..., raw: _bool = ..., result_type: None = ..., args=..., @@ -1097,7 +1095,7 @@ class DataFrame(NDFrame, OpsMixin): def apply( self, f: Callable[..., S1], - axis: AxisType = ..., + axis: Axis = ..., raw: _bool = ..., args=..., *, @@ -1108,7 +1106,7 @@ class DataFrame(NDFrame, OpsMixin): def apply( self, f: Callable[..., ListLikeExceptSeriesAndStr | Series | Mapping], - axis: AxisType = ..., + axis: Axis = ..., raw: _bool = ..., args=..., *, @@ -1119,7 +1117,7 @@ class DataFrame(NDFrame, OpsMixin): def apply( self, f: Callable[..., ListLikeExceptSeriesAndStr | Mapping], - axis: AxisType = ..., + axis: Axis = ..., raw: _bool = ..., args=..., *, @@ -1130,7 +1128,7 @@ class DataFrame(NDFrame, OpsMixin): def apply( self, f: Callable[..., ListLikeExceptSeriesAndStr | Series | Scalar | Mapping], - axis: AxisType = ..., + axis: Axis = ..., raw: _bool = ..., args=..., *, @@ -1143,7 +1141,7 @@ class DataFrame(NDFrame, OpsMixin): def apply( self, f: Callable[..., Series], - axis: AxisTypeIndex = ..., + axis: AxisIndex = ..., raw: _bool = ..., args=..., *, @@ -1160,7 +1158,7 @@ class DataFrame(NDFrame, OpsMixin): result_type: None = ..., args=..., *, - axis: AxisTypeColumn, + axis: AxisColumn, **kwargs, ) -> Series[S1]: ... @overload @@ -1171,7 +1169,7 @@ class DataFrame(NDFrame, OpsMixin): result_type: None = ..., args=..., *, - axis: AxisTypeColumn, + axis: AxisColumn, **kwargs, ) -> Series: ... @overload @@ -1182,7 +1180,7 @@ class DataFrame(NDFrame, OpsMixin): result_type: None = ..., args=..., *, - axis: AxisTypeColumn, + axis: AxisColumn, **kwargs, ) -> DataFrame: ... @@ -1194,7 +1192,7 @@ class DataFrame(NDFrame, OpsMixin): raw: _bool = ..., args=..., *, - axis: AxisTypeColumn, + axis: AxisColumn, result_type: Literal["reduce"], **kwargs, ) -> DataFrame: ... @@ -1243,30 +1241,30 @@ class DataFrame(NDFrame, OpsMixin): def corrwith( self, other: DataFrame | Series, - axis: AxisType | None = ..., + axis: Axis | None = ..., drop: _bool = ..., method: Literal["pearson", "kendall", "spearman"] = ..., numeric_only: _bool = ..., ) -> Series: ... @overload def count( - self, axis: AxisType = ..., numeric_only: _bool = ..., *, level: Level + self, axis: Axis = ..., numeric_only: _bool = ..., *, level: Level ) -> DataFrame: ... @overload def count( - self, axis: AxisType = ..., level: None = ..., numeric_only: _bool = ... + self, axis: Axis = ..., level: None = ..., numeric_only: _bool = ... ) -> Series: ... - def nunique(self, axis: AxisType = ..., dropna: bool = ...) -> Series: ... + def nunique(self, axis: Axis = ..., dropna: bool = ...) -> Series: ... def idxmax( - self, axis: AxisType = ..., skipna: _bool = ..., numeric_only: _bool = ... + self, axis: Axis = ..., skipna: _bool = ..., numeric_only: _bool = ... ) -> Series: ... def idxmin( - self, axis: AxisType = ..., skipna: _bool = ..., numeric_only: _bool = ... + self, axis: Axis = ..., skipna: _bool = ..., numeric_only: _bool = ... ) -> Series: ... @overload def mode( self, - axis: AxisType = ..., + axis: Axis = ..., skipna: _bool = ..., numeric_only: _bool = ..., *, @@ -1276,7 +1274,7 @@ class DataFrame(NDFrame, OpsMixin): @overload def mode( self, - axis: AxisType = ..., + axis: Axis = ..., skipna: _bool = ..., level: None = ..., numeric_only: _bool = ..., @@ -1286,7 +1284,7 @@ class DataFrame(NDFrame, OpsMixin): def quantile( self, q: float = ..., - axis: AxisType = ..., + axis: Axis = ..., numeric_only: _bool = ..., interpolation: QuantileInterpolation = ..., method: CalculationMethod = ..., @@ -1295,7 +1293,7 @@ class DataFrame(NDFrame, OpsMixin): def quantile( self, q: list[float] | np.ndarray, - axis: AxisType = ..., + axis: Axis = ..., numeric_only: _bool = ..., interpolation: QuantileInterpolation = ..., method: CalculationMethod = ..., @@ -1304,11 +1302,11 @@ class DataFrame(NDFrame, OpsMixin): self, freq=..., how: TimestampConvention = ..., - axis: AxisType = ..., + axis: Axis = ..., copy: _bool = ..., ) -> DataFrame: ... def to_period( - self, freq: _str | None = ..., axis: AxisType = ..., copy: _bool = ... + self, freq: _str | None = ..., axis: Axis = ..., copy: _bool = ... ) -> DataFrame: ... def isin(self, values: Iterable | Series | DataFrame | dict) -> DataFrame: ... @property @@ -1390,7 +1388,7 @@ class DataFrame(NDFrame, OpsMixin): def add( self, other: num | ListLike | DataFrame, - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... @@ -1407,7 +1405,7 @@ class DataFrame(NDFrame, OpsMixin): @overload def all( self, - axis: AxisType = ..., + axis: Axis = ..., bool_only: _bool | None = ..., skipna: _bool = ..., **kwargs, @@ -1425,7 +1423,7 @@ class DataFrame(NDFrame, OpsMixin): def any( self, *, - axis: AxisType = ..., + axis: Axis = ..., bool_only: _bool | None = ..., skipna: _bool = ..., **kwargs, @@ -1449,19 +1447,19 @@ class DataFrame(NDFrame, OpsMixin): self, time: _str | datetime.time, asof: _bool = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., ) -> DataFrame: ... def between_time( self, start_time: _str | datetime.time, end_time: _str | datetime.time, - axis: AxisType | None = ..., + axis: Axis | None = ..., ) -> DataFrame: ... @overload def bfill( self, *, - axis: AxisType | None = ..., + axis: Axis | None = ..., inplace: Literal[True], limit: int | None = ..., downcast: dict | None = ..., @@ -1470,7 +1468,7 @@ class DataFrame(NDFrame, OpsMixin): def bfill( self, *, - axis: AxisType | None = ..., + axis: Axis | None = ..., inplace: Literal[False] = ..., limit: int | None = ..., downcast: dict | None = ..., @@ -1480,22 +1478,22 @@ class DataFrame(NDFrame, OpsMixin): lower: float | None = ..., upper: float | None = ..., *, - axis: AxisType | None = ..., + axis: Axis | None = ..., inplace: _bool = ..., **kwargs, ) -> DataFrame: ... def copy(self, deep: _bool = ...) -> DataFrame: ... def cummax( - self, axis: AxisType | None = ..., skipna: _bool = ..., *args, **kwargs + self, axis: Axis | None = ..., skipna: _bool = ..., *args, **kwargs ) -> DataFrame: ... def cummin( - self, axis: AxisType | None = ..., skipna: _bool = ..., *args, **kwargs + self, axis: Axis | None = ..., skipna: _bool = ..., *args, **kwargs ) -> DataFrame: ... def cumprod( - self, axis: AxisType | None = ..., skipna: _bool = ..., *args, **kwargs + self, axis: Axis | None = ..., skipna: _bool = ..., *args, **kwargs ) -> DataFrame: ... def cumsum( - self, axis: AxisType | None = ..., skipna: _bool = ..., *args, **kwargs + self, axis: Axis | None = ..., skipna: _bool = ..., *args, **kwargs ) -> DataFrame: ... def describe( self, @@ -1507,23 +1505,19 @@ class DataFrame(NDFrame, OpsMixin): def div( self, other: num | ListLike | DataFrame, - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... def divide( self, other: num | ListLike | DataFrame, - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... - def droplevel( - self, level: Level | list[Level], axis: AxisType = ... - ) -> DataFrame: ... - def eq( - self, other, axis: AxisType = ..., level: Level | None = ... - ) -> DataFrame: ... + def droplevel(self, level: Level | list[Level], axis: Axis = ...) -> DataFrame: ... + def eq(self, other, axis: Axis = ..., level: Level | None = ...) -> DataFrame: ... def equals(self, other: Series | DataFrame) -> _bool: ... def ewm( self, @@ -1534,19 +1528,19 @@ class DataFrame(NDFrame, OpsMixin): min_periods: int = ..., adjust: _bool = ..., ignore_na: _bool = ..., - axis: AxisType = ..., + axis: Axis = ..., ) -> ExponentialMovingWindow[DataFrame]: ... def expanding( self, min_periods: int = ..., - axis: AxisType = ..., + axis: Axis = ..., method: CalculationMethod = ..., ) -> Expanding[DataFrame]: ... @overload def ffill( self, *, - axis: AxisType | None = ..., + axis: Axis | None = ..., inplace: Literal[True], limit: int | None = ..., downcast: dict | None = ..., @@ -1555,7 +1549,7 @@ class DataFrame(NDFrame, OpsMixin): def ffill( self, *, - axis: AxisType | None = ..., + axis: Axis | None = ..., inplace: Literal[False] = ..., limit: int | None = ..., downcast: dict | None = ..., @@ -1565,26 +1559,22 @@ class DataFrame(NDFrame, OpsMixin): items: list | None = ..., like: _str | None = ..., regex: _str | None = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., ) -> DataFrame: ... def first(self, offset) -> DataFrame: ... def first_valid_index(self) -> Scalar: ... def floordiv( self, other: num | ListLike | DataFrame, - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... # def from_dict # def from_records - def ge( - self, other, axis: AxisType = ..., level: Level | None = ... - ) -> DataFrame: ... + def ge(self, other, axis: Axis = ..., level: Level | None = ...) -> DataFrame: ... # def get - def gt( - self, other, axis: AxisType = ..., level: Level | None = ... - ) -> DataFrame: ... + def gt(self, other, axis: Axis = ..., level: Level | None = ...) -> DataFrame: ... def head(self, n: int = ...) -> DataFrame: ... def infer_objects(self) -> DataFrame: ... # def info @@ -1593,7 +1583,7 @@ class DataFrame(NDFrame, OpsMixin): self, method: _str = ..., *, - axis: AxisType = ..., + axis: Axis = ..., limit: int | None = ..., limit_direction: Literal["forward", "backward", "both"] = ..., limit_area: Literal["inside", "outside"] | None = ..., @@ -1606,7 +1596,7 @@ class DataFrame(NDFrame, OpsMixin): self, method: _str = ..., *, - axis: AxisType = ..., + axis: Axis = ..., limit: int | None = ..., limit_direction: Literal["forward", "backward", "both"] = ..., limit_area: Literal["inside", "outside"] | None = ..., @@ -1619,7 +1609,7 @@ class DataFrame(NDFrame, OpsMixin): self, method: _str = ..., *, - axis: AxisType = ..., + axis: Axis = ..., limit: int | None = ..., inplace: _bool | None = ..., limit_direction: Literal["forward", "backward", "both"] = ..., @@ -1630,7 +1620,7 @@ class DataFrame(NDFrame, OpsMixin): def keys(self) -> Index: ... def kurt( self, - axis: AxisType | None = ..., + axis: Axis | None = ..., skipna: _bool | None = ..., level: None = ..., numeric_only: _bool = ..., @@ -1638,7 +1628,7 @@ class DataFrame(NDFrame, OpsMixin): ) -> Series: ... def kurtosis( self, - axis: AxisType | None = ..., + axis: Axis | None = ..., skipna: _bool | None = ..., level: None = ..., numeric_only: _bool = ..., @@ -1646,25 +1636,21 @@ class DataFrame(NDFrame, OpsMixin): ) -> Series: ... def last(self, offset) -> DataFrame: ... def last_valid_index(self) -> Scalar: ... - def le( - self, other, axis: AxisType = ..., level: Level | None = ... - ) -> DataFrame: ... - def lt( - self, other, axis: AxisType = ..., level: Level | None = ... - ) -> DataFrame: ... + def le(self, other, axis: Axis = ..., level: Level | None = ...) -> DataFrame: ... + def lt(self, other, axis: Axis = ..., level: Level | None = ...) -> DataFrame: ... def mask( self, cond: Series | DataFrame | np.ndarray, other=..., *, inplace: _bool = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., try_cast: _bool = ..., ) -> DataFrame: ... def max( self, - axis: AxisType | None = ..., + axis: Axis | None = ..., skipna: _bool | None = ..., level: None = ..., numeric_only: _bool = ..., @@ -1672,7 +1658,7 @@ class DataFrame(NDFrame, OpsMixin): ) -> Series: ... def mean( self, - axis: AxisType | None = ..., + axis: Axis | None = ..., skipna: _bool | None = ..., level: None = ..., numeric_only: _bool = ..., @@ -1680,7 +1666,7 @@ class DataFrame(NDFrame, OpsMixin): ) -> Series: ... def median( self, - axis: AxisType | None = ..., + axis: Axis | None = ..., skipna: _bool | None = ..., level: None = ..., numeric_only: _bool = ..., @@ -1688,7 +1674,7 @@ class DataFrame(NDFrame, OpsMixin): ) -> Series: ... def min( self, - axis: AxisType | None = ..., + axis: Axis | None = ..., skipna: _bool | None = ..., level: None = ..., numeric_only: _bool = ..., @@ -1697,27 +1683,25 @@ class DataFrame(NDFrame, OpsMixin): def mod( self, other: num | ListLike | DataFrame, - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... def mul( self, other: num | ListLike | DataFrame, - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... def multiply( self, other: num | ListLike | DataFrame, - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... - def ne( - self, other, axis: AxisType = ..., level: Level | None = ... - ) -> DataFrame: ... + def ne(self, other, axis: Axis = ..., level: Level | None = ...) -> DataFrame: ... def pct_change( self, periods: int = ..., @@ -1736,13 +1720,13 @@ class DataFrame(NDFrame, OpsMixin): def pow( self, other: num | ListLike | DataFrame, - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... def prod( self, - axis: AxisType | None = ..., + axis: Axis | None = ..., skipna: _bool | None = ..., level: None = ..., numeric_only: _bool = ..., @@ -1751,7 +1735,7 @@ class DataFrame(NDFrame, OpsMixin): ) -> Series: ... def product( self, - axis: AxisType | None = ..., + axis: Axis | None = ..., skipna: _bool = ..., level: None = ..., numeric_only: _bool = ..., @@ -1761,13 +1745,13 @@ class DataFrame(NDFrame, OpsMixin): def radd( self, other, - axis: AxisType = ..., + axis: Axis = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... def rank( self, - axis: AxisType = ..., + axis: Axis = ..., method: Literal["average", "min", "max", "first", "dense"] = ..., numeric_only: _bool = ..., na_option: Literal["keep", "top", "bottom"] = ..., @@ -1777,7 +1761,7 @@ class DataFrame(NDFrame, OpsMixin): def rdiv( self, other, - axis: AxisType = ..., + axis: Axis = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... @@ -1793,7 +1777,7 @@ class DataFrame(NDFrame, OpsMixin): def rename_axis( self, mapper=..., - axis: AxisType | None = ..., + axis: Axis | None = ..., copy: _bool = ..., *, inplace: Literal[True], @@ -1802,7 +1786,7 @@ class DataFrame(NDFrame, OpsMixin): def rename_axis( self, mapper=..., - axis: AxisType | None = ..., + axis: Axis | None = ..., copy: _bool = ..., *, inplace: Literal[False] = ..., @@ -1828,7 +1812,7 @@ class DataFrame(NDFrame, OpsMixin): def resample( self, rule, - axis: AxisType = ..., + axis: Axis = ..., closed: _str | None = ..., label: _str | None = ..., convention: TimestampConvention = ..., @@ -1843,21 +1827,21 @@ class DataFrame(NDFrame, OpsMixin): def rfloordiv( self, other, - axis: AxisType = ..., + axis: Axis = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... def rmod( self, other, - axis: AxisType = ..., + axis: Axis = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... def rmul( self, other, - axis: AxisType = ..., + axis: Axis = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... @@ -1868,7 +1852,7 @@ class DataFrame(NDFrame, OpsMixin): min_periods: int | None = ..., center: _bool = ..., on: Hashable | None = ..., - axis: AxisType = ..., + axis: Axis = ..., closed: IntervalClosedType | None = ..., step: int | None = ..., method: CalculationMethod = ..., @@ -1882,7 +1866,7 @@ class DataFrame(NDFrame, OpsMixin): min_periods: int | None = ..., center: _bool = ..., on: Hashable | None = ..., - axis: AxisType = ..., + axis: Axis = ..., closed: IntervalClosedType | None = ..., step: int | None = ..., method: CalculationMethod = ..., @@ -1892,21 +1876,21 @@ class DataFrame(NDFrame, OpsMixin): def rpow( self, other, - axis: AxisType = ..., + axis: Axis = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... def rsub( self, other, - axis: AxisType = ..., + axis: Axis = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... def rtruediv( self, other, - axis: AxisType = ..., + axis: Axis = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... @@ -1918,12 +1902,12 @@ class DataFrame(NDFrame, OpsMixin): replace: _bool = ..., weights: _str | ListLike | None = ..., random_state: RandomState | None = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., ignore_index: _bool = ..., ) -> DataFrame: ... def sem( self, - axis: AxisType | None = ..., + axis: Axis | None = ..., skipna: _bool | None = ..., level: None = ..., ddof: int = ..., @@ -1931,20 +1915,20 @@ class DataFrame(NDFrame, OpsMixin): **kwargs, ) -> Series: ... # Not actually positional, but used to handle removal of deprecated - def set_axis(self, labels, *, axis: AxisType, copy: _bool = ...) -> DataFrame: ... + def set_axis(self, labels, *, axis: Axis, copy: _bool = ...) -> DataFrame: ... def skew( self, - axis: AxisType | None = ..., + axis: Axis | None = ..., skipna: _bool | None = ..., level: None = ..., numeric_only: _bool = ..., **kwargs, ) -> Series: ... - def slice_shift(self, periods: int = ..., axis: AxisType = ...) -> DataFrame: ... - def squeeze(self, axis: AxisType | None = ...): ... + def slice_shift(self, periods: int = ..., axis: Axis = ...) -> DataFrame: ... + def squeeze(self, axis: Axis | None = ...): ... def std( self, - axis: AxisType = ..., + axis: Axis = ..., skipna: _bool = ..., level: None = ..., ddof: int = ..., @@ -1954,40 +1938,36 @@ class DataFrame(NDFrame, OpsMixin): def sub( self, other: num | ListLike | DataFrame, - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... def subtract( self, other: num | ListLike | DataFrame, - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... def sum( self, - axis: AxisType | None = ..., + axis: Axis | None = ..., skipna: _bool | None = ..., level: None = ..., numeric_only: _bool = ..., min_count: int = ..., **kwargs, ) -> Series: ... - def swapaxes( - self, axis1: AxisType, axis2: AxisType, copy: _bool = ... - ) -> DataFrame: ... + def swapaxes(self, axis1: Axis, axis2: Axis, copy: _bool = ...) -> DataFrame: ... def tail(self, n: int = ...) -> DataFrame: ... def take( self, indices: list, - axis: AxisType = ..., + axis: Axis = ..., is_copy: _bool | None = ..., **kwargs, ) -> DataFrame: ... - def tshift( - self, periods: int = ..., freq=..., axis: AxisType = ... - ) -> DataFrame: ... + def tshift(self, periods: int = ..., freq=..., axis: Axis = ...) -> DataFrame: ... def to_clipboard( self, excel: _bool = ..., sep: _str | None = ..., **kwargs ) -> None: ... @@ -2073,7 +2053,7 @@ class DataFrame(NDFrame, OpsMixin): def truediv( self, other: num | ListLike | DataFrame, - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., fill_value: float | None = ..., ) -> DataFrame: ... @@ -2081,21 +2061,21 @@ class DataFrame(NDFrame, OpsMixin): self, before: datetime.date | _str | int | None = ..., after: datetime.date | _str | int | None = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., copy: _bool = ..., ) -> DataFrame: ... # def tshift def tz_convert( self, tz, - axis: AxisType = ..., + axis: Axis = ..., level: Level | None = ..., copy: _bool = ..., ) -> DataFrame: ... def tz_localize( self, tz, - axis: AxisType = ..., + axis: Axis = ..., level: Level | None = ..., copy: _bool = ..., ambiguous=..., @@ -2103,7 +2083,7 @@ class DataFrame(NDFrame, OpsMixin): ) -> DataFrame: ... def var( self, - axis: AxisType | None = ..., + axis: Axis | None = ..., skipna: _bool | None = ..., level: None = ..., ddof: int = ..., @@ -2120,7 +2100,7 @@ class DataFrame(NDFrame, OpsMixin): other=..., *, inplace: _bool = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., try_cast: _bool = ..., ) -> DataFrame: ... diff --git a/pandas-stubs/core/generic.pyi b/pandas-stubs/core/generic.pyi index 557607d9f..0cbeb7f54 100644 --- a/pandas-stubs/core/generic.pyi +++ b/pandas-stubs/core/generic.pyi @@ -27,6 +27,7 @@ from pandas._typing import ( S1, ArrayLike, Axis, + AxisIndex, CompressionOptions, CSVQuoting, Dtype, @@ -42,7 +43,6 @@ from pandas._typing import ( Level, NDFrameT, ReplaceMethod, - SeriesAxisType, SortKind, StorageOptions, T, @@ -77,9 +77,9 @@ class NDFrame(PandasObject, indexing.IndexingMixin): @property def size(self) -> int: ... def swapaxes( - self, axis1: SeriesAxisType, axis2: SeriesAxisType, copy: _bool = ... + self, axis1: AxisIndex, axis2: AxisIndex, copy: _bool = ... ) -> NDFrame: ... - def droplevel(self, level: Level, axis: SeriesAxisType = ...) -> NDFrame: ... + def droplevel(self, level: Level, axis: AxisIndex = ...) -> NDFrame: ... def pop(self, item: _str) -> NDFrame: ... def squeeze(self, axis=...): ... def equals(self, other: Series[S1]) -> _bool: ... @@ -292,7 +292,7 @@ class NDFrame(PandasObject, indexing.IndexingMixin): def xs( self, key: Hashable, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., level: Level | None = ..., drop_level: _bool = ..., ) -> DataFrame | Series: ... @@ -347,7 +347,7 @@ class NDFrame(PandasObject, indexing.IndexingMixin): def sort_index( self, *, - axis: Literal["columns", "index", 0, 1] = ..., + axis: Axis = ..., level=..., ascending: _bool = ..., inplace: _bool = ..., diff --git a/pandas-stubs/core/groupby/generic.pyi b/pandas-stubs/core/groupby/generic.pyi index bd9dbc7c5..c17923a51 100644 --- a/pandas-stubs/core/groupby/generic.pyi +++ b/pandas-stubs/core/groupby/generic.pyi @@ -29,7 +29,7 @@ from pandas._typing import ( S1, AggFuncTypeBase, AggFuncTypeFrame, - AxisType, + Axis, Level, ListLike, RandomState, @@ -92,7 +92,7 @@ class SeriesGroupBy(GroupBy, Generic[S1]): fill_method: str = ..., limit=..., freq=..., - axis: AxisType = ..., + axis: Axis = ..., ) -> Series[float]: ... # Overrides and others from original pylance stubs @property @@ -100,10 +100,10 @@ class SeriesGroupBy(GroupBy, Generic[S1]): @property def is_monotonic_decreasing(self) -> bool: ... def bfill(self, limit: int | None = ...) -> Series[S1]: ... - def cummax(self, axis: AxisType = ..., **kwargs) -> Series[S1]: ... - def cummin(self, axis: AxisType = ..., **kwargs) -> Series[S1]: ... - def cumprod(self, axis: AxisType = ..., **kwargs) -> Series[S1]: ... - def cumsum(self, axis: AxisType = ..., **kwargs) -> Series[S1]: ... + def cummax(self, axis: Axis = ..., **kwargs) -> Series[S1]: ... + def cummin(self, axis: Axis = ..., **kwargs) -> Series[S1]: ... + def cumprod(self, axis: Axis = ..., **kwargs) -> Series[S1]: ... + def cumsum(self, axis: Axis = ..., **kwargs) -> Series[S1]: ... def ffill(self, limit: int | None = ...) -> Series[S1]: ... def first(self, **kwargs) -> Series[S1]: ... def head(self, n: int = ...) -> Series[S1]: ... @@ -143,8 +143,8 @@ class SeriesGroupBy(GroupBy, Generic[S1]): legend: bool = ..., **kwargs, ) -> AxesSubplot: ... - def idxmax(self, axis: AxisType = ..., skipna: bool = ...) -> Series: ... - def idxmin(self, axis: AxisType = ..., skipna: bool = ...) -> Series: ... + def idxmax(self, axis: Axis = ..., skipna: bool = ...) -> Series: ... + def idxmin(self, axis: Axis = ..., skipna: bool = ...) -> Series: ... class _DataFrameGroupByScalar(DataFrameGroupBy): def __iter__(self) -> Iterator[tuple[Scalar, DataFrame]]: ... @@ -201,23 +201,23 @@ class DataFrameGroupBy(GroupBy): # These are "properties" but properties can't have all these arguments?! def corr(self, method: str | Callable, min_periods: int = ...) -> DataFrame: ... def cov(self, min_periods: int = ...) -> DataFrame: ... - def diff(self, periods: int = ..., axis: AxisType = ...) -> DataFrame: ... + def diff(self, periods: int = ..., axis: Axis = ...) -> DataFrame: ... def bfill(self, limit: int | None = ...) -> DataFrame: ... def corrwith( self, other: DataFrame, - axis: AxisType = ..., + axis: Axis = ..., drop: bool = ..., method: str = ..., ) -> Series: ... def cummax( - self, axis: AxisType = ..., numeric_only: bool = ..., **kwargs + self, axis: Axis = ..., numeric_only: bool = ..., **kwargs ) -> DataFrame: ... def cummin( - self, axis: AxisType = ..., numeric_only: bool = ..., **kwargs + self, axis: Axis = ..., numeric_only: bool = ..., **kwargs ) -> DataFrame: ... - def cumprod(self, axis: AxisType = ..., **kwargs) -> DataFrame: ... - def cumsum(self, axis: AxisType = ..., **kwargs) -> DataFrame: ... + def cumprod(self, axis: Axis = ..., **kwargs) -> DataFrame: ... + def cumsum(self, axis: Axis = ..., **kwargs) -> DataFrame: ... def describe(self, **kwargs) -> DataFrame: ... def ffill(self, limit: int | None = ...) -> DataFrame: ... @overload @@ -225,7 +225,7 @@ class DataFrameGroupBy(GroupBy): self, value, method: str | None = ..., - axis: AxisType = ..., + axis: Axis = ..., limit: int | None = ..., downcast: dict | None = ..., *, @@ -236,7 +236,7 @@ class DataFrameGroupBy(GroupBy): self, value, method: str | None = ..., - axis: AxisType = ..., + axis: Axis = ..., limit: int | None = ..., downcast: dict | None = ..., *, @@ -247,7 +247,7 @@ class DataFrameGroupBy(GroupBy): self, value, method: str | None = ..., - axis: AxisType = ..., + axis: Axis = ..., inplace: bool = ..., limit: int | None = ..., downcast: dict | None = ..., @@ -274,10 +274,10 @@ class DataFrameGroupBy(GroupBy): **kwargs, ) -> AxesSubplot | Sequence[AxesSubplot]: ... def idxmax( - self, axis: AxisType = ..., skipna: bool = ..., numeric_only: bool = ... + self, axis: Axis = ..., skipna: bool = ..., numeric_only: bool = ... ) -> DataFrame: ... def idxmin( - self, axis: AxisType = ..., skipna: bool = ..., numeric_only: bool = ... + self, axis: Axis = ..., skipna: bool = ..., numeric_only: bool = ... ) -> DataFrame: ... def last(self, **kwargs) -> DataFrame: ... def max(self, **kwargs) -> DataFrame: ... @@ -291,7 +291,7 @@ class DataFrameGroupBy(GroupBy): fill_method: str = ..., limit=..., freq=..., - axis: AxisType = ..., + axis: Axis = ..., ) -> DataFrame: ... def prod(self, numeric_only: bool = ..., min_count: int = ...) -> DataFrame: ... def quantile( @@ -311,13 +311,13 @@ class DataFrameGroupBy(GroupBy): self, periods: int = ..., freq: str = ..., - axis: AxisType = ..., + axis: Axis = ..., fill_value=..., ) -> DataFrame: ... @overload def skew( self, - axis: AxisType = ..., + axis: Axis = ..., skipna: bool = ..., numeric_only: bool = ..., *, @@ -327,7 +327,7 @@ class DataFrameGroupBy(GroupBy): @overload def skew( self, - axis: AxisType = ..., + axis: Axis = ..., skipna: bool = ..., level: None = ..., numeric_only: bool = ..., @@ -342,8 +342,8 @@ class DataFrameGroupBy(GroupBy): engine_kwargs=..., ) -> DataFrame: ... def tail(self, n: int = ...) -> DataFrame: ... - def take(self, indices: Sequence, axis: AxisType = ..., **kwargs) -> DataFrame: ... - def tshift(self, periods: int, freq=..., axis: AxisType = ...) -> DataFrame: ... + def take(self, indices: Sequence, axis: Axis = ..., **kwargs) -> DataFrame: ... + def tshift(self, periods: int, freq=..., axis: Axis = ...) -> DataFrame: ... def var(self, ddof: int = ..., numeric_only: bool = ...) -> DataFrame: ... @overload def value_counts( diff --git a/pandas-stubs/core/groupby/groupby.pyi b/pandas-stubs/core/groupby/groupby.pyi index 46f074622..573f9bfb1 100644 --- a/pandas-stubs/core/groupby/groupby.pyi +++ b/pandas-stubs/core/groupby/groupby.pyi @@ -15,7 +15,7 @@ from pandas.core.indexes.api import Index from pandas.core.series import Series from pandas._typing import ( - AxisType, + Axis, KeysArgType, NDFrameT, npt, @@ -79,20 +79,18 @@ class GroupBy(BaseGroupBy[NDFrameT]): pct: bool = ..., axis: int = ..., ) -> DataFrame: ... - def cummax(self, axis: AxisType = ..., **kwargs) -> DataFrame | Series: ... - def cummin(self, axis: AxisType = ..., **kwargs) -> DataFrame | Series: ... - def cumprod(self, axis: AxisType = ..., **kwargs) -> DataFrame | Series: ... - def cumsum(self, axis: AxisType = ..., **kwargs) -> DataFrame | Series: ... - def shift( - self, periods: int = ..., freq=..., axis: AxisType = ..., fill_value=... - ): ... + def cummax(self, axis: Axis = ..., **kwargs) -> DataFrame | Series: ... + def cummin(self, axis: Axis = ..., **kwargs) -> DataFrame | Series: ... + def cumprod(self, axis: Axis = ..., **kwargs) -> DataFrame | Series: ... + def cumsum(self, axis: Axis = ..., **kwargs) -> DataFrame | Series: ... + def shift(self, periods: int = ..., freq=..., axis: Axis = ..., fill_value=...): ... def pct_change( self, periods: int = ..., fill_method: str = ..., limit=..., freq=..., - axis: AxisType = ..., + axis: Axis = ..., ) -> DataFrame | Series: ... def head(self, n: int = ...) -> DataFrame | Series: ... def tail(self, n: int = ...) -> DataFrame | Series: ... diff --git a/pandas-stubs/core/resample.pyi b/pandas-stubs/core/resample.pyi index f38fdbab6..23de00bf3 100644 --- a/pandas-stubs/core/resample.pyi +++ b/pandas-stubs/core/resample.pyi @@ -21,7 +21,7 @@ from pandas.core.groupby.groupby import BaseGroupBy from typing_extensions import TypeAlias from pandas._typing import ( - AxisType, + Axis, NDFrameT, Scalar, npt, @@ -149,7 +149,7 @@ class Resampler(BaseGroupBy, Generic[NDFrameT]): self, method: _Interpolation = ..., *, - axis: AxisType = ..., + axis: Axis = ..., limit: int | None = ..., inplace: Literal[True], limit_direction: Literal["forward", "backward", "both"] = ..., @@ -162,7 +162,7 @@ class Resampler(BaseGroupBy, Generic[NDFrameT]): self, method: _Interpolation = ..., *, - axis: AxisType = ..., + axis: Axis = ..., limit: int | None = ..., inplace: Literal[False] = ..., limit_direction: Literal["forward", "backward", "both"] = ..., diff --git a/pandas-stubs/core/reshape/concat.pyi b/pandas-stubs/core/reshape/concat.pyi index 8d770f5d4..f8fc436c5 100644 --- a/pandas-stubs/core/reshape/concat.pyi +++ b/pandas-stubs/core/reshape/concat.pyi @@ -14,6 +14,8 @@ from pandas import ( ) from pandas._typing import ( + AxisColumn, + AxisIndex, HashableT1, HashableT2, HashableT3, @@ -24,7 +26,7 @@ from pandas._typing import ( def concat( objs: Iterable[DataFrame] | Mapping[HashableT1, DataFrame], *, - axis: Literal[0, "index"] = ..., + axis: AxisIndex = ..., join: Literal["inner", "outer"] = ..., ignore_index: bool = ..., keys: list[HashableT2] = ..., @@ -38,7 +40,7 @@ def concat( def concat( objs: Iterable[Series] | Mapping[HashableT1, Series], *, - axis: Literal[0, "index"] = ..., + axis: AxisIndex = ..., join: Literal["inner", "outer"] = ..., ignore_index: bool = ..., keys: list[HashableT2] = ..., @@ -52,7 +54,7 @@ def concat( def concat( objs: Iterable[Series | DataFrame] | Mapping[HashableT1, Series | DataFrame], *, - axis: Literal[1, "columns"], + axis: AxisColumn, join: Literal["inner", "outer"] = ..., ignore_index: bool = ..., keys: list[HashableT2] = ..., diff --git a/pandas-stubs/core/series.pyi b/pandas-stubs/core/series.pyi index 79a6f2a18..e06e7e7b8 100644 --- a/pandas-stubs/core/series.pyi +++ b/pandas-stubs/core/series.pyi @@ -85,7 +85,8 @@ from pandas._typing import ( ArrayLike, Axes, Axis, - AxisType, + AxisColumn, + AxisIndex, BooleanDtypeArg, BytesDtypeArg, CalculationMethod, @@ -116,7 +117,6 @@ from pandas._typing import ( Renamer, ReplaceMethod, Scalar, - SeriesAxisType, SortKind, StrDtypeArg, TimedeltaDtypeArg, @@ -310,14 +310,14 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): other: num | _ListLike | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[float]: ... def rdiv( self, other: Series[S1] | Scalar, level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[S1]: ... @property def dtype(self) -> DtypeObj: ... @@ -341,7 +341,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def take( self, indices: Sequence, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., is_copy: _bool | None = ..., **kwargs, ) -> Series[S1]: ... @@ -360,7 +360,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def __getitem__(self, idx: int | _str) -> S1: ... def __setitem__(self, key, value) -> None: ... def repeat( - self, repeats: int | list[int], axis: SeriesAxisType | None = ... + self, repeats: int | list[int], axis: AxisIndex | None = ... ) -> Series[S1]: ... @property def index(self) -> Index | MultiIndex: ... @@ -509,7 +509,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def groupby( self, by: Scalar, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., level: Level | None = ..., as_index: _bool = ..., sort: _bool = ..., @@ -522,7 +522,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def groupby( self, by: GroupByObjectNonScalar = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., level: Level | None = ..., as_index: _bool = ..., sort: _bool = ..., @@ -552,10 +552,10 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): ) -> Series[S1] | None: ... def duplicated(self, keep: NaPosition | Literal[False] = ...) -> Series[_bool]: ... def idxmax( - self, axis: SeriesAxisType = ..., skipna: _bool = ..., *args, **kwargs + self, axis: AxisIndex = ..., skipna: _bool = ..., *args, **kwargs ) -> int | _str: ... def idxmin( - self, axis: SeriesAxisType = ..., skipna: _bool = ..., *args, **kwargs + self, axis: AxisIndex = ..., skipna: _bool = ..., *args, **kwargs ) -> int | _str: ... def round(self, decimals: int = ..., *args, **kwargs) -> Series[S1]: ... @overload @@ -607,7 +607,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def compare( self, other: Series, - align_axis: SeriesAxisType, + align_axis: AxisIndex, keep_shape: bool = ..., keep_equal: bool = ..., ) -> Series: ... @@ -615,7 +615,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def compare( self, other: Series, - align_axis: Literal["columns", 1] = ..., + align_axis: AxisColumn = ..., keep_shape: bool = ..., keep_equal: bool = ..., ) -> DataFrame: ... @@ -628,7 +628,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def sort_values( self, *, - axis: AxisType = ..., + axis: Axis = ..., ascending: _bool | Sequence[_bool] = ..., kind: SortKind = ..., na_position: NaPosition = ..., @@ -640,7 +640,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def sort_values( self, *, - axis: AxisType = ..., + axis: Axis = ..., ascending: _bool | Sequence[_bool] = ..., kind: SortKind = ..., na_position: NaPosition = ..., @@ -652,7 +652,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def sort_values( self, *, - axis: AxisType = ..., + axis: Axis = ..., ascending: _bool | Sequence[_bool] = ..., inplace: _bool | None = ..., kind: SortKind = ..., @@ -664,7 +664,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def sort_index( self, *, - axis: AxisType = ..., + axis: Axis = ..., level: Level | None = ..., ascending: _bool | Sequence[_bool] = ..., kind: SortKind = ..., @@ -678,7 +678,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def sort_index( self, *, - axis: AxisType = ..., + axis: Axis = ..., level: Level | list[int] | list[_str] | None = ..., ascending: _bool | Sequence[_bool] = ..., kind: SortKind = ..., @@ -692,7 +692,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def sort_index( self, *, - axis: AxisType = ..., + axis: Axis = ..., level: Level | list[int] | list[_str] | None = ..., ascending: _bool | Sequence[_bool] = ..., inplace: _bool | None = ..., @@ -704,7 +704,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): ) -> Series | None: ... def argsort( self, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., kind: SortKind = ..., order: None = ..., ) -> Series[int]: ... @@ -729,7 +729,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def aggregate( self, func: AggFuncTypeBase, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., *args, **kwargs, ) -> S1: ... @@ -737,7 +737,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def aggregate( self, func: AggFuncTypeSeriesToFrame = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., *args, **kwargs, ) -> Series[S1]: ... @@ -746,7 +746,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def transform( self, func: AggFuncTypeBase, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., *args, **kwargs, ) -> Series[S1]: ... @@ -754,7 +754,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def transform( self, func: list[AggFuncTypeBase] | AggFuncTypeDictFrame, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., *args, **kwargs, ) -> DataFrame: ... @@ -778,14 +778,14 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): self, other: DataFrame | Series, join: JoinHow = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., level: Level | None = ..., copy: _bool = ..., fill_value=..., method: FillnaOptions | None = ..., limit: int | None = ..., - fill_axis: SeriesAxisType = ..., - broadcast_axis: SeriesAxisType | None = ..., + fill_axis: AxisIndex = ..., + broadcast_axis: AxisIndex | None = ..., ) -> tuple[Series, Series]: ... @overload def rename( @@ -881,7 +881,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): value: Scalar | NAType | dict | Series[S1] | DataFrame | None = ..., *, method: FillnaOptions | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., limit: int | None = ..., downcast: dict | None = ..., inplace: Literal[True], @@ -892,7 +892,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): value: Scalar | NAType | dict | Series[S1] | DataFrame | None = ..., *, method: FillnaOptions | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., limit: int | None = ..., downcast: dict | None = ..., inplace: Literal[False] = ..., @@ -903,7 +903,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): value: Scalar | NAType | dict | Series[S1] | DataFrame | None = ..., *, method: FillnaOptions | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., inplace: _bool = ..., limit: int | None = ..., downcast: dict | None = ..., @@ -945,7 +945,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): self, periods: int = ..., freq=..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., fill_value: object | None = ..., ) -> Series[S1]: ... def memory_usage(self, index: _bool = ..., deep: _bool = ...) -> int: ... @@ -964,7 +964,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def dropna( self, *, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., inplace: Literal[True], how: Literal["any", "all"] | None = ..., ) -> None: ... @@ -972,7 +972,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def dropna( self, *, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., inplace: Literal[False] = ..., how: Literal["any", "all"] | None = ..., ) -> Series[S1]: ... @@ -980,7 +980,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def dropna( self, *, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., inplace: _bool = ..., how: Literal["any", "all"] | None = ..., ) -> Series[S1] | None: ... @@ -1013,13 +1013,13 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): **kwargs, ) -> SubplotBase: ... def swapaxes( - self, axis1: SeriesAxisType, axis2: SeriesAxisType, copy: _bool = ... + self, axis1: AxisIndex, axis2: AxisIndex, copy: _bool = ... ) -> Series[S1]: ... def droplevel( - self, level: Level | list[Level], axis: SeriesAxisType = ... + self, level: Level | list[Level], axis: AxisIndex = ... ) -> DataFrame: ... def pop(self, item: _str) -> Series[S1]: ... - def squeeze(self, axis: SeriesAxisType | None = ...) -> Scalar: ... + def squeeze(self, axis: AxisIndex | None = ...) -> Scalar: ... def __abs__(self) -> Series[S1]: ... def add_prefix(self, prefix: _str) -> Series[S1]: ... def add_suffix(self, suffix: _str) -> Series[S1]: ... @@ -1038,7 +1038,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): items: _ListLike | None = ..., like: _str | None = ..., regex: _str | None = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., ) -> Series[S1]: ... def head(self, n: int = ...) -> Series[S1]: ... def tail(self, n: int = ...) -> Series[S1]: ... @@ -1049,7 +1049,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): replace: _bool = ..., weights: _str | _ListLike | np.ndarray | None = ..., random_state: RandomState | None = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., ignore_index: _bool = ..., ) -> Series[S1]: ... @overload @@ -1135,7 +1135,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def ffill( self, *, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., inplace: Literal[True], limit: int | None = ..., downcast: dict | None = ..., @@ -1144,7 +1144,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def ffill( self, *, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., inplace: Literal[False] = ..., limit: int | None = ..., downcast: dict | None = ..., @@ -1153,7 +1153,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def bfill( self, *, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., inplace: Literal[True], limit: int | None = ..., downcast: dict | None = ..., @@ -1162,7 +1162,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def bfill( self, *, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., inplace: Literal[False] = ..., limit: int | None = ..., downcast: dict | None = ..., @@ -1172,7 +1172,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): self, *, value: S1 | dict | Series[S1] | DataFrame, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., inplace: _bool = ..., limit: int | None = ..., downcast: dict | None = ..., @@ -1201,7 +1201,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): "from_derivatives", ] = ..., *, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., limit: int | None = ..., inplace: _bool = ..., limit_direction: Literal["forward", "backward", "both"] | None = ..., @@ -1219,7 +1219,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): lower: AnyArrayLike | float | None = ..., upper: AnyArrayLike | float | None = ..., *, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., inplace: _bool = ..., **kwargs, ) -> Series[S1]: ... @@ -1235,18 +1235,18 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): self, time: _str | time, asof: _bool = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., ) -> Series[S1]: ... def between_time( self, start_time: _str | time, end_time: _str | time, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., ) -> Series[S1]: ... def resample( self, rule, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., closed: _str | None = ..., label: _str | None = ..., convention: TimestampConvention = ..., @@ -1263,7 +1263,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def last(self, offset) -> Series[S1]: ... def rank( self, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., method: Literal["average", "min", "max", "first", "dense"] = ..., numeric_only: _bool = ..., na_option: Literal["keep", "top", "bottom"] = ..., @@ -1280,7 +1280,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): other=..., *, inplace: _bool = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., level: Level | None = ..., try_cast: _bool = ..., ) -> Series[S1]: ... @@ -1290,34 +1290,32 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): other: Scalar | Series[S1] | DataFrame | Callable = ..., *, inplace: _bool = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., level: Level | None = ..., try_cast: _bool = ..., ) -> Series[S1]: ... - def slice_shift( - self, periods: int = ..., axis: SeriesAxisType = ... - ) -> Series[S1]: ... + def slice_shift(self, periods: int = ..., axis: AxisIndex = ...) -> Series[S1]: ... def tshift( - self, periods: int = ..., freq=..., axis: SeriesAxisType = ... + self, periods: int = ..., freq=..., axis: AxisIndex = ... ) -> Series[S1]: ... def truncate( self, before: date | _str | int | None = ..., after: date | _str | int | None = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., copy: _bool = ..., ) -> Series[S1]: ... def tz_convert( self, tz, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., level: Level | None = ..., copy: _bool = ..., ) -> Series[S1]: ... def tz_localize( self, tz, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., level: Level | None = ..., copy: _bool = ..., ambiguous=..., @@ -1488,7 +1486,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): ) -> Series[S1]: ... def all( self, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., bool_only: _bool | None = ..., skipna: _bool = ..., **kwargs, @@ -1496,43 +1494,43 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): def any( self, *, - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., bool_only: _bool | None = ..., skipna: _bool = ..., **kwargs, ) -> _bool: ... def cummax( - self, axis: SeriesAxisType | None = ..., skipna: _bool = ..., *args, **kwargs + self, axis: AxisIndex | None = ..., skipna: _bool = ..., *args, **kwargs ) -> Series[S1]: ... def cummin( - self, axis: SeriesAxisType | None = ..., skipna: _bool = ..., *args, **kwargs + self, axis: AxisIndex | None = ..., skipna: _bool = ..., *args, **kwargs ) -> Series[S1]: ... def cumprod( - self, axis: SeriesAxisType | None = ..., skipna: _bool = ..., *args, **kwargs + self, axis: AxisIndex | None = ..., skipna: _bool = ..., *args, **kwargs ) -> Series[S1]: ... def cumsum( - self, axis: SeriesAxisType | None = ..., skipna: _bool = ..., *args, **kwargs + self, axis: AxisIndex | None = ..., skipna: _bool = ..., *args, **kwargs ) -> Series[S1]: ... def divide( self, other: num | _ListLike | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[float]: ... def divmod( self, other: num | _ListLike | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[S1]: ... def eq( self, other: Scalar | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[_bool]: ... def ewm( self, @@ -1543,12 +1541,12 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): min_periods: int = ..., adjust: _bool = ..., ignore_na: _bool = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> ExponentialMovingWindow[Series]: ... def expanding( self, min_periods: int = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., method: CalculationMethod = ..., ) -> Expanding[Series]: ... def floordiv( @@ -1556,26 +1554,26 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): other: num | _ListLike | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., ) -> Series[int]: ... def ge( self, other: Scalar | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[_bool]: ... def gt( self, other: Scalar | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[_bool]: ... def item(self) -> S1: ... def kurt( self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool = ..., level: None = ..., numeric_only: _bool = ..., @@ -1583,7 +1581,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): ) -> Scalar: ... def kurtosis( self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool = ..., level: None = ..., numeric_only: _bool = ..., @@ -1594,18 +1592,18 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): other: Scalar | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[_bool]: ... def lt( self, other: Scalar | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[_bool]: ... def max( self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool = ..., level: None = ..., numeric_only: _bool = ..., @@ -1613,7 +1611,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): ) -> S1: ... def mean( self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool = ..., level: None = ..., numeric_only: _bool = ..., @@ -1621,7 +1619,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): ) -> float: ... def median( self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool = ..., level: None = ..., numeric_only: _bool = ..., @@ -1629,7 +1627,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): ) -> float: ... def min( self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool = ..., level: None = ..., numeric_only: _bool = ..., @@ -1640,28 +1638,28 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): other: num | _ListLike | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., ) -> Series[S1]: ... def mul( self, other: num | _ListLike | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., ) -> Series[S1]: ... def multiply( self, other: num | _ListLike | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., ) -> Series[S1]: ... def ne( self, other: Scalar | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[_bool]: ... def nunique(self, dropna: _bool = ...) -> int: ... def pow( @@ -1669,11 +1667,11 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): other: num | _ListLike | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., ) -> Series[S1]: ... def prod( self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool | None = ..., level: None = ..., numeric_only: _bool = ..., @@ -1682,7 +1680,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): ) -> Scalar: ... def product( self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool | None = ..., level: None = ..., numeric_only: _bool = ..., @@ -1694,35 +1692,35 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): other: Series[S1] | Scalar, level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[S1]: ... def rdivmod( self, other: Series[S1] | Scalar, level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[S1]: ... def rfloordiv( self, other, level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[S1]: ... def rmod( self, other: Series[S1] | Scalar, level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[S1]: ... def rmul( self, other: Series[S1] | Scalar, level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[S1]: ... @overload def rolling( @@ -1731,7 +1729,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): min_periods: int | None = ..., center: _bool = ..., on: _str | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., closed: IntervalClosedType | None = ..., step: int | None = ..., method: CalculationMethod = ..., @@ -1745,7 +1743,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): min_periods: int | None = ..., center: _bool = ..., on: _str | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., closed: IntervalClosedType | None = ..., step: int | None = ..., method: CalculationMethod = ..., @@ -1757,25 +1755,25 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): other: Series[S1] | Scalar, level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[S1]: ... def rsub( self, other: Series[S1] | Scalar, level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[S1]: ... def rtruediv( self, other, level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[S1]: ... def sem( self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool | None = ..., level: None = ..., ddof: int = ..., @@ -1784,7 +1782,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): ) -> Scalar: ... def skew( self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool | None = ..., level: None = ..., numeric_only: _bool = ..., @@ -1792,7 +1790,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): ) -> Scalar: ... def std( self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool | None = ..., level: None = ..., ddof: int = ..., @@ -1804,18 +1802,18 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): other: num | _ListLike | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., ) -> Series[S1]: ... def subtract( self, other: num | _ListLike | Series[S1], level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., ) -> Series[S1]: ... def sum( self: Series[S1], - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool | None = ..., level: None = ..., numeric_only: _bool = ..., @@ -1836,11 +1834,11 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): other, level: Level | None = ..., fill_value: float | None = ..., - axis: SeriesAxisType = ..., + axis: AxisIndex = ..., ) -> Series[float]: ... def var( self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool | None = ..., level: None = ..., ddof: int = ..., @@ -1853,7 +1851,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): mapper: Scalar | ListLike = ..., index: Scalar | ListLike | Callable | dict | None = ..., columns: Scalar | ListLike | Callable | dict | None = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., copy: _bool = ..., *, inplace: Literal[True], @@ -1864,7 +1862,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]): mapper: Scalar | ListLike = ..., index: Scalar | ListLike | Callable | dict | None = ..., columns: Scalar | ListLike | Callable | dict | None = ..., - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., copy: _bool = ..., inplace: Literal[False] = ..., ) -> Series: ... @@ -1883,7 +1881,7 @@ class TimestampSeries(Series[Timestamp]): def __truediv__(self, other: float | Series[int] | Series[float] | Sequence[float]) -> TimestampSeries: ... # type: ignore[override] def mean( # type: ignore[override] self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool = ..., level: None = ..., numeric_only: _bool = ..., @@ -1891,7 +1889,7 @@ class TimestampSeries(Series[Timestamp]): ) -> Timestamp: ... def median( # type: ignore[override] self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool = ..., level: None = ..., numeric_only: _bool = ..., @@ -1899,7 +1897,7 @@ class TimestampSeries(Series[Timestamp]): ) -> Timestamp: ... def std( # type: ignore[override] self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool | None = ..., level: None = ..., ddof: int = ..., @@ -1929,7 +1927,7 @@ class TimedeltaSeries(Series[Timedelta]): def dt(self) -> TimedeltaProperties: ... # type: ignore[override] def mean( # type: ignore[override] self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool = ..., level: None = ..., numeric_only: _bool = ..., @@ -1937,7 +1935,7 @@ class TimedeltaSeries(Series[Timedelta]): ) -> Timedelta: ... def median( # type: ignore[override] self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool = ..., level: None = ..., numeric_only: _bool = ..., @@ -1945,7 +1943,7 @@ class TimedeltaSeries(Series[Timedelta]): ) -> Timedelta: ... def std( # type: ignore[override] self, - axis: SeriesAxisType | None = ..., + axis: AxisIndex | None = ..., skipna: _bool | None = ..., level: None = ..., ddof: int = ..., diff --git a/pandas-stubs/io/formats/style.pyi b/pandas-stubs/io/formats/style.pyi index 1d852aa5b..770df865e 100644 --- a/pandas-stubs/io/formats/style.pyi +++ b/pandas-stubs/io/formats/style.pyi @@ -14,7 +14,7 @@ from pandas.core.frame import DataFrame from pandas.core.series import Series from pandas._typing import ( - AxisType, + Axis, FilePath, HashableT, HashableT1, @@ -197,7 +197,7 @@ class Styler(StylerRenderer[Styler]): def apply( self, func: Callable[[Series], list | Series], - axis: AxisType = ..., + axis: Axis = ..., subset: Subset | None = ..., **kwargs: Any, ) -> Styler: ... @@ -212,14 +212,14 @@ class Styler(StylerRenderer[Styler]): def apply_index( self, func: Callable[[Series], npt.NDArray[np.str_] | list[str] | Series[str]], - axis: AxisType = ..., + axis: Axis = ..., level: Level | list[Level] | None = ..., **kwargs: Any, ) -> Styler: ... def applymap_index( self, func: Callable[[Scalar], str], - axis: AxisType = ..., + axis: Axis = ..., level: Level | list[Level] | None = ..., **kwargs: Any, ) -> Styler: ... @@ -233,21 +233,21 @@ class Styler(StylerRenderer[Styler]): def set_caption(self, caption: str | tuple[str, str]) -> Styler: ... def set_sticky( self, - axis: AxisType = ..., + axis: Axis = ..., pixel_size: int | None = ..., levels: Level | list[Level] | None = ..., ) -> Styler: ... def set_table_styles( self, table_styles: dict[HashableT, CSSStyles] | CSSStyles | None = ..., - axis: AxisType = ..., + axis: Axis = ..., overwrite: bool = ..., css_class_names: dict[str, str] | None = ..., ) -> Styler: ... def hide( self, subset: Subset | None = ..., - axis: AxisType = ..., + axis: Axis = ..., level: Level | list[Level] | None = ..., names: bool = ..., ) -> Styler: ... @@ -256,7 +256,7 @@ class Styler(StylerRenderer[Styler]): cmap: str | Colormap = ..., low: float = ..., high: float = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., subset: Subset | None = ..., text_color_threshold: float = ..., vmin: float | None = ..., @@ -273,7 +273,7 @@ class Styler(StylerRenderer[Styler]): cmap: str | Colormap = ..., low: float = ..., high: float = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., subset: Subset | None = ..., # In docs but not in function declaration # text_color_threshold: float @@ -292,7 +292,7 @@ class Styler(StylerRenderer[Styler]): def bar( self, subset: Subset | None = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., *, color: str | list[str] | tuple[str, str] | None = ..., cmap: str | Colormap = ..., @@ -315,21 +315,21 @@ class Styler(StylerRenderer[Styler]): self, subset: Subset | None = ..., color: str = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., props: str | None = ..., ) -> Styler: ... def highlight_min( self, subset: Subset | None = ..., color: str = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., props: str | None = ..., ) -> Styler: ... def highlight_between( self, subset: Subset | None = ..., color: str = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., left: Scalar | list[Scalar] | None = ..., right: Scalar | list[Scalar] | None = ..., inclusive: IntervalClosedType = ..., @@ -339,7 +339,7 @@ class Styler(StylerRenderer[Styler]): self, subset: Subset | None = ..., color: str = ..., - axis: AxisType | None = ..., + axis: Axis | None = ..., q_left: float = ..., q_right: float = ..., interpolation: QuantileInterpolation = ..., diff --git a/pandas-stubs/io/formats/style_render.pyi b/pandas-stubs/io/formats/style_render.pyi index f30c40457..dd33670be 100644 --- a/pandas-stubs/io/formats/style_render.pyi +++ b/pandas-stubs/io/formats/style_render.pyi @@ -16,7 +16,7 @@ from pandas.core.indexing import _IndexSlice from typing_extensions import TypeAlias from pandas._typing import ( - AxisType, + Axis, HashableT, Level, ) @@ -67,7 +67,7 @@ class StylerRenderer(Generic[_StylerT]): def format_index( self, formatter: ExtFormatter | None = ..., - axis: AxisType = ..., + axis: Axis = ..., level: Level | list[Level] | None = ..., na_rep: str | None = ..., precision: int | None = ..., @@ -79,6 +79,6 @@ class StylerRenderer(Generic[_StylerT]): def relabel_index( self, labels: Sequence[str] | Index, - axis: AxisType = ..., + axis: Axis = ..., level: Level | list[Level] | None = ..., ) -> _StylerT: ...