-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The map method is overloaded into two variant.
def map(
self, func: PythonFuncType, na_action: str | None = None, **kwargs
) -> DataFrame:
def map(
self,
arg: Callable | Mapping | Series,
na_action: Literal["ignore"] | None = None,
) -> Series:The second one being a valid call for the below code. But I get the error
main.py|30 col 57-58 error| Argument of type "dict[str, bool]" cannot be assigned to parameter "func" of type "PythonFuncType" in function "map" Type "dict[str, bool]" is not assignable to type "PythonFuncType"
Which suggest it is not checking the other variant?
Code or Screenshots
import pandas as pd;
def mapDataFrame(df: DataFrame):
d = {"Yes": True, "No": False};
df["International plan"] = df["International plan"].map(d);Third Party Library
name = "pandas"
version = "2.2.3"
VS Code extension or command-line
pyright 1.1.403 command-line
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working