Skip to content

Commit 40f0b71

Browse files
authored
pandas 2.0 removals for NDFrame and subclasses (#930)
* Remove pandas 2.0 deprecations from NDFrame and subclasses * Fix pyright * Fix matplotlib warnings * Revert "Fix matplotlib warnings" This reverts commit f324108. * Revert "Fix pyright" This reverts commit 16d331c.
1 parent 2602494 commit 40f0b71

File tree

3 files changed

+4
-42
lines changed

3 files changed

+4
-42
lines changed

pandas-stubs/core/frame.pyi

+1-14
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,6 @@ class DataFrame(NDFrame, OpsMixin):
668668
allow_duplicates: _bool = ...,
669669
) -> None: ...
670670
def assign(self, **kwargs) -> DataFrame: ...
671-
def lookup(self, row_labels: Sequence, col_labels: Sequence) -> np.ndarray: ...
672671
def align(
673672
self,
674673
other: NDFrameT,
@@ -1691,7 +1690,6 @@ class DataFrame(NDFrame, OpsMixin):
16911690
percentiles: list[float] | None = ...,
16921691
include: Literal["all"] | list[Dtype] | None = ...,
16931692
exclude: list[Dtype] | None = ...,
1694-
datetime_is_numeric: _bool | None = ...,
16951693
) -> DataFrame: ...
16961694
def div(
16971695
self,
@@ -1850,7 +1848,6 @@ class DataFrame(NDFrame, OpsMixin):
18501848
inplace: _bool = ...,
18511849
axis: Axis | None = ...,
18521850
level: Level | None = ...,
1853-
try_cast: _bool = ...,
18541851
) -> DataFrame: ...
18551852
def max(
18561853
self,
@@ -2107,7 +2104,6 @@ class DataFrame(NDFrame, OpsMixin):
21072104
numeric_only: _bool = ...,
21082105
**kwargs,
21092106
) -> Series: ...
2110-
def slice_shift(self, periods: int = ..., axis: Axis = ...) -> DataFrame: ...
21112107
def squeeze(self, axis: Axis | None = ...): ...
21122108
def std(
21132109
self,
@@ -2143,14 +2139,7 @@ class DataFrame(NDFrame, OpsMixin):
21432139
) -> Series: ...
21442140
def swapaxes(self, axis1: Axis, axis2: Axis, copy: _bool = ...) -> DataFrame: ...
21452141
def tail(self, n: int = ...) -> DataFrame: ...
2146-
def take(
2147-
self,
2148-
indices: list,
2149-
axis: Axis = ...,
2150-
is_copy: _bool | None = ...,
2151-
**kwargs,
2152-
) -> DataFrame: ...
2153-
def tshift(self, periods: int = ..., freq=..., axis: Axis = ...) -> DataFrame: ...
2142+
def take(self, indices: list, axis: Axis = ..., **kwargs) -> DataFrame: ...
21542143
def to_clipboard(
21552144
self, excel: _bool = ..., sep: _str | None = ..., **kwargs
21562145
) -> None: ...
@@ -2289,7 +2278,6 @@ class DataFrame(NDFrame, OpsMixin):
22892278
axis: Axis | None = ...,
22902279
copy: _bool = ...,
22912280
) -> DataFrame: ...
2292-
# def tshift
22932281
def tz_convert(
22942282
self,
22952283
tz,
@@ -2329,7 +2317,6 @@ class DataFrame(NDFrame, OpsMixin):
23292317
inplace: _bool = ...,
23302318
axis: Axis | None = ...,
23312319
level: Level | None = ...,
2332-
try_cast: _bool = ...,
23332320
) -> DataFrame: ...
23342321
# Move from generic because Series is Generic and it returns Series[bool] there
23352322
def __invert__(self) -> DataFrame: ...

pandas-stubs/core/generic.pyi

+2-16
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ class NDFrame(indexing.IndexingMixin):
197197
self,
198198
buf: FilePath | WriteBuffer[str],
199199
columns: list[_str] | None = ...,
200-
col_space: int | None = ...,
201200
header: _bool | list[_str] = ...,
202201
index: _bool = ...,
203202
na_rep: _str = ...,
@@ -223,7 +222,6 @@ class NDFrame(indexing.IndexingMixin):
223222
self,
224223
buf: None = ...,
225224
columns: list[_str] | None = ...,
226-
col_space: int | None = ...,
227225
header: _bool | list[_str] = ...,
228226
index: _bool = ...,
229227
na_rep: _str = ...,
@@ -294,9 +292,7 @@ class NDFrame(indexing.IndexingMixin):
294292
errors: _str = ...,
295293
storage_options: StorageOptions = ...,
296294
) -> _str: ...
297-
def take(
298-
self, indices, axis=..., is_copy: _bool | None = ..., **kwargs
299-
) -> Self: ...
295+
def take(self, indices, axis=..., **kwargs) -> Self: ...
300296
def __delitem__(self, idx: Hashable) -> None: ...
301297
def reindex_like(
302298
self,
@@ -474,7 +470,6 @@ class NDFrame(indexing.IndexingMixin):
474470
inplace: _bool = ...,
475471
axis=...,
476472
level=...,
477-
try_cast: _bool = ...,
478473
): ...
479474
def mask(
480475
self,
@@ -484,11 +479,8 @@ class NDFrame(indexing.IndexingMixin):
484479
inplace: _bool = ...,
485480
axis=...,
486481
level=...,
487-
try_cast: _bool = ...,
488482
): ...
489483
def shift(self, periods=..., freq=..., axis=..., fill_value=...) -> Self: ...
490-
def slice_shift(self, periods: int = ..., axis=...) -> Self: ...
491-
def tshift(self, periods: int = ..., freq=..., axis=...) -> Self: ...
492484
def truncate(self, before=..., after=..., axis=..., copy: _bool = ...) -> Self: ...
493485
def tz_convert(self, tz, axis=..., level=..., copy: _bool = ...) -> Self: ...
494486
def tz_localize(
@@ -501,13 +493,7 @@ class NDFrame(indexing.IndexingMixin):
501493
nonexistent: str = ...,
502494
) -> Self: ...
503495
def abs(self) -> Self: ...
504-
def describe(
505-
self,
506-
percentiles=...,
507-
include=...,
508-
exclude=...,
509-
datetime_is_numeric: _bool | None = ...,
510-
) -> NDFrame: ...
496+
def describe(self, percentiles=..., include=..., exclude=...) -> NDFrame: ...
511497
def pct_change(
512498
self, periods=..., fill_method=..., limit=..., freq=..., **kwargs
513499
) -> Self: ...

pandas-stubs/core/series.pyi

+1-12
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
372372
@property
373373
def axes(self) -> list: ...
374374
def take(
375-
self,
376-
indices: Sequence,
377-
axis: AxisIndex = ...,
378-
is_copy: _bool | None = ...,
379-
**kwargs,
375+
self, indices: Sequence, axis: AxisIndex = ..., **kwargs
380376
) -> Series[S1]: ...
381377
def __getattr__(self, name: _str) -> S1: ...
382378
@overload
@@ -1429,7 +1425,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
14291425
inplace: _bool = ...,
14301426
axis: AxisIndex | None = ...,
14311427
level: Level | None = ...,
1432-
try_cast: _bool = ...,
14331428
) -> Series[S1]: ...
14341429
def mask(
14351430
self,
@@ -1445,11 +1440,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
14451440
inplace: _bool = ...,
14461441
axis: AxisIndex | None = ...,
14471442
level: Level | None = ...,
1448-
try_cast: _bool = ...,
1449-
) -> Series[S1]: ...
1450-
def slice_shift(self, periods: int = ..., axis: AxisIndex = ...) -> Series[S1]: ...
1451-
def tshift(
1452-
self, periods: int = ..., freq=..., axis: AxisIndex = ...
14531443
) -> Series[S1]: ...
14541444
def truncate(
14551445
self,
@@ -1480,7 +1470,6 @@ class Series(IndexOpsMixin[S1], NDFrame):
14801470
percentiles: list[float] | None = ...,
14811471
include: Literal["all"] | list[S1] | None = ...,
14821472
exclude: S1 | list[S1] | None = ...,
1483-
datetime_is_numeric: _bool | None = ...,
14841473
) -> Series[S1]: ...
14851474
def pct_change(
14861475
self,

0 commit comments

Comments
 (0)