Skip to content

Commit b1192b3

Browse files
color455nmcolor455nm
and
color455nm
authored
typing improvements on level and fill_value in Series.eq (#54729)
* typing improvements on level and fill_value in Series.eq * minor fix * Typing improvements freq in Series.to_timestamp * change typing from str to Frequency --------- Co-authored-by: color455nm <color455nm@example.com>
1 parent 9aa40b9 commit b1192b3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pandas/core/series.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
DtypeBackend,
167167
DtypeObj,
168168
FilePath,
169+
Frequency,
169170
IgnoreRaise,
170171
IndexKeyFunc,
171172
IndexLabel,
@@ -5630,7 +5631,7 @@ def dropna(
56305631

56315632
def to_timestamp(
56325633
self,
5633-
freq=None,
5634+
freq: Frequency | None = None,
56345635
how: Literal["s", "e", "start", "end"] = "start",
56355636
copy: bool | None = None,
56365637
) -> Series:
@@ -5945,7 +5946,13 @@ def _flex_method(self, other, op, *, level=None, fill_value=None, axis: Axis = 0
59455946
return op(self, other)
59465947

59475948
@Appender(ops.make_flex_doc("eq", "series"))
5948-
def eq(self, other, level=None, fill_value=None, axis: Axis = 0) -> Series:
5949+
def eq(
5950+
self,
5951+
other,
5952+
level: Level | None = None,
5953+
fill_value: float | None = None,
5954+
axis: Axis = 0,
5955+
) -> Series:
59495956
return self._flex_method(
59505957
other, operator.eq, level=level, fill_value=fill_value, axis=axis
59515958
)

0 commit comments

Comments
 (0)