Skip to content

typing improvements on level and fill_value in Series.eq #54729

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 4 commits into from
Aug 25, 2023
Merged
Changes from all commits
Commits
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
11 changes: 9 additions & 2 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
DtypeBackend,
DtypeObj,
FilePath,
Frequency,
IgnoreRaise,
IndexKeyFunc,
IndexLabel,
Expand Down Expand Up @@ -5630,7 +5631,7 @@ def dropna(

def to_timestamp(
self,
freq=None,
freq: Frequency | None = None,
how: Literal["s", "e", "start", "end"] = "start",
copy: bool | None = None,
) -> Series:
Expand Down Expand Up @@ -5946,7 +5947,13 @@ def _flex_method(self, other, op, *, level=None, fill_value=None, axis: Axis = 0
return op(self, other)

@Appender(ops.make_flex_doc("eq", "series"))
def eq(self, other, level=None, fill_value=None, axis: Axis = 0) -> Series:
def eq(
self,
other,
level: Level | None = None,
fill_value: float | None = None,
axis: Axis = 0,
) -> Series:
return self._flex_method(
other, operator.eq, level=level, fill_value=fill_value, axis=axis
)
Expand Down