Skip to content

Commit b05a6c2

Browse files
authored
changed str to literal in inteprolate and limit_direction (#52755)
changed it to literal
1 parent 8ca2e37 commit b05a6c2

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

pandas/core/generic.py

+22-2
Original file line numberDiff line numberDiff line change
@@ -7497,12 +7497,32 @@ def replace(
74977497

74987498
def interpolate(
74997499
self,
7500-
method: str = "linear",
7500+
method: Literal[
7501+
"linear",
7502+
"time",
7503+
"index",
7504+
"values",
7505+
"pad",
7506+
"nearest",
7507+
"zero",
7508+
"slinear",
7509+
"quadratic",
7510+
"cubic",
7511+
"barycentric",
7512+
"polynomial",
7513+
"krogh",
7514+
"piecewise_polynomial",
7515+
"spline",
7516+
"pchip",
7517+
"akima",
7518+
"cubicspline",
7519+
"from_derivatives",
7520+
] = "linear",
75017521
*,
75027522
axis: Axis = 0,
75037523
limit: int | None = None,
75047524
inplace: bool_t = False,
7505-
limit_direction: str | None = None,
7525+
limit_direction: Literal["forward", "backward", "both"] | None = None,
75067526
limit_area: str | None = None,
75077527
downcast: str | None = None,
75087528
**kwargs,

0 commit comments

Comments
 (0)