You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Indicate which type checker you are using (mypy or pyright):
Pylance in Visual Studio Code
Show the error message received from that type checker while checking your example.
Argument of type "Literal[1]" cannot be assigned to parameter "axis" of type "AxisIndex | None" in function "sample"
Type "Literal[1]" is not assignable to type "AxisIndex | None"
"Literal[1]" is not assignable to "None"
"Literal[1]" is not assignable to "Literal['index']"
"Literal[1]" is not assignable to type "Literal[0]"
Describe the bug
The DataFrame.sample function has an argument called
axis
that accepts either of the axis, but the type only allows 'index' or0
.To Reproduce
pandas
example that is not properly checked by the stubs.mypy
orpyright
):Please complete the following information:
pandas-stubs
: 2.2.3.250527Additional context
Add any other context about the problem here.
Pandas Docs showing the type of the
axis
argument: https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.sample.htmlThe text was updated successfully, but these errors were encountered: