Skip to content

MAINT: Bump pandas to 1.5.0 #317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5c8f2b7
MAINT: Bump pandas to 1.5.0
bashtage Sep 20, 2022
198cd61
MAINT: Remove deprecated argument
bashtage Sep 20, 2022
7f7547c
MAINT: Remove deprecated argument
bashtage Sep 20, 2022
a273543
MAINT: Remove deprecated argument
bashtage Sep 20, 2022
6077a06
MAINT: Remove deprecated argument, add missing
bashtage Sep 20, 2022
59a3e1f
MAINT: Remove deprecated argument, add missing
bashtage Sep 20, 2022
93c1d23
MAINT: Remove deprecated argument, add missing
bashtage Sep 20, 2022
af34b24
MAINT: Remove deprecated argument, add missing
bashtage Sep 20, 2022
bfabde1
MAINT: Remove deprecated argument, add missing
bashtage Sep 20, 2022
8b1b164
MAINT: Remove deprecated argument
bashtage Sep 20, 2022
693c101
MAINT: Remove deprecated argument
bashtage Sep 20, 2022
f318212
MAINT: Remove deprecated argument
bashtage Sep 20, 2022
a739249
MAINT: Fix errors created by deprecations
bashtage Sep 20, 2022
52fa043
TST: Update tests for 1.5
bashtage Sep 20, 2022
f468280
TST: Fix issues due to changes in tests
bashtage Sep 20, 2022
15699fa
CLN: Final cleanups for 1.5.x compat
bashtage Sep 20, 2022
b781bbe
Merge remote-tracking branch 'upstream/main' into move-to-1.5.0
Sep 22, 2022
68ef1c2
MAINT: Implement remaining deprecations
Sep 23, 2022
48cdc77
MAINT: Fix small typing issues
bashtage Sep 23, 2022
905fd1d
REV: Revery changes to factorize
bashtage Sep 24, 2022
b97aec2
MAINT: Remove properties from ExcelWriter
bashtage Sep 24, 2022
32a0668
ENH: Add new argument to resample
bashtage Sep 24, 2022
5da6992
CLN: Remove __array__wrap__
bashtage Sep 24, 2022
1a1f685
ENH: Add numeric_only to windowing
bashtage Sep 24, 2022
508f600
ENH: Add styler changes
bashtage Sep 24, 2022
e263803
REV: Revertexcel deletions
bashtage Sep 24, 2022
7e251b5
REV: Revert groupby changes
bashtage Sep 24, 2022
dccf9aa
CLN: Remove older deprecated code
bashtage Sep 24, 2022
f74fafb
BUG: Fix rsplit type when expand is True
Sep 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions pandas-stubs/core/arrays/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ class ExtensionArray:
def unique(self): ...
def searchsorted(self, value, side: str = ..., sorter=...): ...
def factorize(
self,
# Not actually positional-only, used to handle deprecations in 1.5.0
*,
use_na_sentinel: bool = ...,
self, na_sentinel: int = ...
) -> tuple[np.ndarray, ABCExtensionArray]: ...
def repeat(self, repeats, axis=...): ...
def take(
Expand Down
13 changes: 6 additions & 7 deletions pandas-stubs/core/arrays/sparse/array.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import numpy as np
from pandas.core.arraylike import OpsMixin
from pandas.core.arrays import ExtensionArray
from pandas.core.arrays import (
ExtensionArray,
ExtensionOpsMixin,
)
from pandas.core.base import PandasObject as PandasObject

class SparseArray(OpsMixin, PandasObject, ExtensionArray):
class SparseArray(PandasObject, ExtensionArray, ExtensionOpsMixin):
def __init__(
self,
data,
Expand Down Expand Up @@ -40,10 +42,7 @@ class SparseArray(OpsMixin, PandasObject, ExtensionArray):
def fillna(self, value=..., method=..., limit=...): ...
def shift(self, periods: int = ..., fill_value=...): ...
def unique(self): ...
# Not actually positional-only, used to handle deprecations in 1.5.0
def factorize(
self, *, use_na_sentinal: bool = ...
) -> tuple[np.ndarray, SparseArray]: ...
def factorize(self, na_sentinel: int = ...): ...
def value_counts(self, dropna: bool = ...): ...
def __getitem__(self, key): ...
def take(self, indices, allow_fill: bool = ..., fill_value=...): ...
Expand Down
1 change: 0 additions & 1 deletion pandas-stubs/core/generic.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class NDFrame(PandasObject, indexing.IndexingMixin):
def empty(self) -> _bool: ...
__array_priority__: int = ...
def __array__(self, dtype=...) -> np.ndarray: ...
def __array_wrap__(self, result, context=...): ...
def to_excel(
self,
excel_writer,
Expand Down
30 changes: 17 additions & 13 deletions pandas-stubs/core/resample.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,12 @@ class Resampler(BaseGroupBy, Generic[NDFrameT]):
**kwargs,
) -> NDFrameT: ...
def asfreq(self, fill_value: Scalar | None = ...) -> NDFrameT: ...
def std(self, ddof: int = ..., *args, **kwargs) -> NDFrameT: ...
def var(self, ddof: int = ..., *args, **kwargs) -> NDFrameT: ...
def std(
self, ddof: int = ..., numeric_only: bool = ..., *args, **kwargs
) -> NDFrameT: ...
def var(
self, ddof: int = ..., numeric_only: bool = ..., *args, **kwargs
) -> NDFrameT: ...
def size(self) -> Series: ...
def count(self) -> NDFrameT: ...
def quantile(
Expand All @@ -171,25 +175,25 @@ class Resampler(BaseGroupBy, Generic[NDFrameT]):
**kwargs,
) -> NDFrameT: ...
def sum(
self, _method: Literal["sum"] = ..., min_count: int = ..., *args, **kwargs
self, numeric_only: bool = ..., min_count: int = ..., *args, **kwargs
) -> NDFrameT: ...
def prod(
self, _method: Literal["prod"] = ..., min_count: int = ..., *args, **kwargs
self, numeric_only: bool = ..., min_count: int = ..., *args, **kwargs
) -> NDFrameT: ...
def min(
self, _method: Literal["min"] = ..., min_count: int = ..., *args, **kwargs
self, numeric_only: bool = ..., min_count: int = ..., *args, **kwargs
) -> NDFrameT: ...
def max(
self, _method: Literal["max"] = ..., min_count: int = ..., *args, **kwargs
self, numeric_only: bool = ..., min_count: int = ..., *args, **kwargs
) -> NDFrameT: ...
def first(
self, _method: Literal["first"] = ..., min_count: int = ..., *args, **kwargs
self, numeric_only: bool = ..., min_count: int = ..., *args, **kwargs
) -> NDFrameT: ...
def last(
self, _method: Literal["last"] = ..., min_count: int = ..., *args, **kwargs
self, numeric_only: bool = ..., min_count: int = ..., *args, **kwargs
) -> NDFrameT: ...
def mean(self, _method: Literal["mean"] = ..., *args, **kwargs) -> NDFrameT: ...
def sem(self, _method: Literal["sem"] = ..., *args, **kwargs) -> NDFrameT: ...
def median(self, _method: Literal["median"] = ..., *args, **kwargs) -> NDFrameT: ...
def ohlc(self, _method: Literal["ohlc"] = ..., *args, **kwargs) -> DataFrame: ...
def nunique(self, _method: Literal["first"] = ..., *args, **kwargs) -> NDFrameT: ...
def mean(self, numeric_only: bool = ..., *args, **kwargs) -> NDFrameT: ...
def sem(self, numeric_only: bool = ..., *args, **kwargs) -> NDFrameT: ...
def median(self, numeric_only: bool = ..., *args, **kwargs) -> NDFrameT: ...
def ohlc(self, *args, **kwargs) -> DataFrame: ...
def nunique(self, *args, **kwargs) -> NDFrameT: ...
8 changes: 6 additions & 2 deletions pandas-stubs/core/window/ewm.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,30 @@ class ExponentialMovingWindow(BaseWindow[NDFrameT], Generic[NDFrameT]):
) -> DataFrame: ...
def mean(
self,
numeric_only: bool = ...,
*,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def sum(
self,
numeric_only: bool = ...,
*,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def std(self, bias: bool = ...) -> NDFrameT: ...
def var(self, bias: bool = ...) -> NDFrameT: ...
def std(self, bias: bool = ..., numeric_only: bool = ...) -> NDFrameT: ...
def var(self, bias: bool = ..., numeric_only: bool = ...) -> NDFrameT: ...
def cov(
self,
other: DataFrame | Series | None = ...,
pairwise: bool | None = ...,
bias: bool = ...,
numeric_only: bool = ...,
) -> NDFrameT: ...
def corr(
self,
other: DataFrame | Series | None = ...,
pairwise: bool | None = ...,
numeric_only: bool = ...,
) -> NDFrameT: ...
23 changes: 20 additions & 3 deletions pandas-stubs/core/window/expanding.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -56,72 +56,89 @@ class Expanding(RollingAndExpandingMixin[NDFrameT]):
) -> NDFrameT: ...
def sum(
self,
numeric_only: bool = ...,
*,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def max(
self,
numeric_only: bool = ...,
*,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def min(
self,
numeric_only: bool = ...,
*,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def mean(
self,
numeric_only: bool = ...,
*,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def median(
self,
numeric_only: bool = ...,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def std(
self,
ddof: int = ...,
numeric_only: bool = ...,
*,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def var(
self,
ddof: int = ...,
numeric_only: bool = ...,
*,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def sem(self, ddof: int = ...) -> NDFrameT: ...
def skew(self) -> NDFrameT: ...
def kurt(self) -> NDFrameT: ...
def sem(self, ddof: int = ..., numeric_only: bool = ...) -> NDFrameT: ...
def skew(
self,
numeric_only: bool = ...,
) -> NDFrameT: ...
def kurt(
self,
numeric_only: bool = ...,
) -> NDFrameT: ...
def quantile(
self,
quantile: float,
interpolation: QuantileInterpolation = ...,
numeric_only: bool = ...,
) -> NDFrameT: ...
def rank(
self,
method: WindowingRankType = ...,
ascending: bool = ...,
pct: bool = ...,
numeric_only: bool = ...,
) -> NDFrameT: ...
def cov(
self,
other: DataFrame | Series | None = ...,
pairwise: bool | None = ...,
ddof: int = ...,
numeric_only: bool = ...,
) -> NDFrameT: ...
def corr(
self,
other: DataFrame | Series | None = ...,
pairwise: bool | None = ...,
ddof: int = ...,
numeric_only: bool = ...,
) -> NDFrameT: ...

class ExpandingGroupby(BaseWindowGroupby, Expanding): ...
33 changes: 26 additions & 7 deletions pandas-stubs/core/window/rolling.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,14 @@ class Window(BaseWindow[NDFrameT]):
*args: Any,
**kwargs: Any,
) -> DataFrame: ...
def sum(self, **kwargs: Any) -> NDFrameT: ...
def mean(self, **kwargs: Any) -> NDFrameT: ...
def var(self, ddof: int = ..., **kwargs: Any) -> NDFrameT: ...
def std(self, ddof: int = ..., **kwargs: Any) -> NDFrameT: ...
def sum(self, numeric_only: bool = ..., **kwargs: Any) -> NDFrameT: ...
def mean(self, numeric_only: bool = ..., **kwargs: Any) -> NDFrameT: ...
def var(
self, ddof: int = ..., numeric_only: bool = ..., *args: Any, **kwargs: Any
) -> NDFrameT: ...
def std(
self, ddof: int = ..., numeric_only: bool = ..., *args: Any, **kwargs: Any
) -> NDFrameT: ...

class RollingAndExpandingMixin(BaseWindow[NDFrameT], Generic[NDFrameT]):
def count(self) -> NDFrameT: ...
Expand All @@ -85,72 +89,87 @@ class RollingAndExpandingMixin(BaseWindow[NDFrameT], Generic[NDFrameT]):
) -> NDFrameT: ...
def sum(
self,
numeric_only: bool = ...,
*,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def max(
self,
numeric_only: bool = ...,
*,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def min(
self,
numeric_only: bool = ...,
*,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def mean(
self,
numeric_only: bool = ...,
*,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def median(
self,
numeric_only: bool = ...,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def std(
self,
ddof: int = ...,
numeric_only: bool = ...,
*,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def var(
self,
ddof: int = ...,
numeric_only: bool = ...,
*,
engine: WindowingEngine = ...,
engine_kwargs: WindowingEngineKwargs = ...,
) -> NDFrameT: ...
def skew(self) -> NDFrameT: ...
def sem(self, ddof: int = ...) -> NDFrameT: ...
def kurt(self) -> NDFrameT: ...
def skew(self, numeric_only: bool = ...) -> NDFrameT: ...
def sem(
self,
ddof: int = ...,
numeric_only: bool = ...,
) -> NDFrameT: ...
def kurt(self, numeric_only: bool = ...) -> NDFrameT: ...
def quantile(
self,
quantile: float,
interpolation: QuantileInterpolation = ...,
numeric_only: bool = ...,
) -> NDFrameT: ...
def rank(
self,
method: WindowingRankType = ...,
ascending: bool = ...,
pct: bool = ...,
numeric_only: bool = ...,
) -> NDFrameT: ...
def cov(
self,
other: DataFrame | Series | None = ...,
pairwise: bool | None = ...,
ddof: int = ...,
numeric_only: bool = ...,
) -> NDFrameT: ...
def corr(
self,
other: DataFrame | Series | None = ...,
pairwise: bool | None = ...,
ddof: int = ...,
numeric_only: bool = ...,
) -> NDFrameT: ...

class Rolling(RollingAndExpandingMixin[NDFrameT]):
Expand Down
15 changes: 0 additions & 15 deletions pandas-stubs/io/excel/_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,6 @@ class ExcelWriter:
if_sheet_exists: Literal["error", "new", "replace", "overlay"] | None = ...,
engine_kwargs: dict[str, Any] | None = ...,
) -> None: ...
@property
def supported_extensions(self) -> tuple[str, ...]: ...
@property
def engine(self) -> Literal["openpyxl", "pyxlsb", "odf"]: ...
@property
def sheets(self) -> dict[str, Any]: ...
@property
def book(self) -> Workbook | OpenDocument | pyxlsb.workbook.Workbook: ...
@property
def date_format(self) -> str: ...
@property
def datetime_format(self) -> str: ...
@property
def if_sheet_exists(self) -> Literal["error", "new", "replace", "overlay"]: ...
def __fspath__(self) -> str: ...
def __enter__(self) -> ExcelWriter: ...
def __exit__(
Expand All @@ -134,7 +120,6 @@ class ExcelWriter:
exc_value: BaseException | None,
traceback: TracebackType | None,
) -> None: ...
def close(self) -> None: ...

class ExcelFile:
engine = ...
Expand Down
Loading