-
-
Notifications
You must be signed in to change notification settings - Fork 150
GH1379 Remove PeriodSeries #1386
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -70,10 +70,7 @@ from pandas.core.generic import NDFrame | |||||
from pandas.core.groupby.generic import SeriesGroupBy | ||||||
from pandas.core.groupby.groupby import BaseGroupBy | ||||||
from pandas.core.indexers import BaseIndexer | ||||||
from pandas.core.indexes.accessors import ( | ||||||
PeriodProperties, | ||||||
_dtDescriptor, | ||||||
) | ||||||
from pandas.core.indexes.accessors import _dtDescriptor | ||||||
from pandas.core.indexes.category import CategoricalIndex | ||||||
from pandas.core.indexes.datetimes import DatetimeIndex | ||||||
from pandas.core.indexes.interval import IntervalIndex | ||||||
|
@@ -363,7 +360,7 @@ class Series(IndexOpsMixin[S1], NDFrame): | |||||
dtype: PeriodDtype = ..., | ||||||
name: Hashable = ..., | ||||||
copy: bool = ..., | ||||||
) -> PeriodSeries: ... | ||||||
) -> Series[Period]: ... | ||||||
@overload | ||||||
def __new__( | ||||||
cls, | ||||||
|
@@ -851,6 +848,8 @@ class Series(IndexOpsMixin[S1], NDFrame): | |||||
@overload | ||||||
def diff(self: Series[Timedelta], periods: int = ...) -> Series[Timedelta]: ... # type: ignore[overload-overlap] | ||||||
@overload | ||||||
def diff(self: Series[Period], periods: int = ...) -> OffsetSeries: ... # type: ignore[overload-overlap] | ||||||
@overload | ||||||
def diff(self, periods: int = ...) -> Series[float]: ... | ||||||
def autocorr(self, lag: int = 1) -> float: ... | ||||||
@overload | ||||||
|
@@ -1695,7 +1694,7 @@ class Series(IndexOpsMixin[S1], NDFrame): | |||||
), | ||||||
) -> Series[Timedelta]: ... | ||||||
@overload | ||||||
def __add__(self: Series[Timedelta], other: Period) -> PeriodSeries: ... | ||||||
def __add__(self: Series[Timedelta], other: Period) -> Series[Period]: ... | ||||||
@overload | ||||||
def __add__(self: Series[bool], other: bool | Sequence[bool]) -> Series[bool]: ... | ||||||
@overload | ||||||
|
@@ -1822,7 +1821,7 @@ class Series(IndexOpsMixin[S1], NDFrame): | |||||
level: Level | None = None, | ||||||
fill_value: float | None = None, | ||||||
axis: int = 0, | ||||||
) -> PeriodSeries: ... | ||||||
) -> Series[Period]: ... | ||||||
@overload | ||||||
def add( | ||||||
self: Series[bool], | ||||||
|
@@ -1957,7 +1956,7 @@ class Series(IndexOpsMixin[S1], NDFrame): | |||||
), | ||||||
) -> Series[Timedelta]: ... | ||||||
@overload | ||||||
def __radd__(self: Series[Timedelta], other: Period) -> PeriodSeries: ... | ||||||
def __radd__(self: Series[Timedelta], other: Period) -> Series[Period]: ... | ||||||
@overload | ||||||
def __radd__(self: Series[bool], other: bool | Sequence[bool]) -> Series[bool]: ... | ||||||
@overload | ||||||
|
@@ -2084,7 +2083,7 @@ class Series(IndexOpsMixin[S1], NDFrame): | |||||
level: Level | None = None, | ||||||
fill_value: float | None = None, | ||||||
axis: int = 0, | ||||||
) -> PeriodSeries: ... | ||||||
) -> Series[Period]: ... | ||||||
@overload | ||||||
def radd( | ||||||
self: Series[bool], | ||||||
|
@@ -3079,7 +3078,7 @@ class Series(IndexOpsMixin[S1], NDFrame): | |||||
other: complex | NumListLike | Index[T_COMPLEX] | Series[T_COMPLEX], | ||||||
) -> Series: ... | ||||||
@overload | ||||||
def __sub__(self, other: Index[Never] | Series[Never]) -> Series: ... | ||||||
def __sub__(self, other: Index[Never] | Series[Never]) -> Series: ... # type: ignore[overload-overlap] | ||||||
@overload | ||||||
def __sub__( | ||||||
self: Series[bool], | ||||||
|
@@ -3201,6 +3200,8 @@ class Series(IndexOpsMixin[S1], NDFrame): | |||||
), | ||||||
) -> Series[Timedelta]: ... | ||||||
@overload | ||||||
def __sub__(self: Series[Period], other: Series[Period]) -> OffsetSeries: ... | ||||||
|
def __sub__(self: Series[Period], other: Series[Period]) -> OffsetSeries: ... | |
def __sub__(self: Series[Period], other: Series[Period]) -> Series[BaseOffset]: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could try the following idea to simplify, if you want.
And
I've first seen the idea in #1362 and it worked again in #1374