Closed
Description
With the most recent pandas-stubs, mypy now complains about every call to itertuples()
Is there a way that I'm supposed to tell the new release what my column names are?
Sample
import pandas as pd
df = pd.DataFrame({"a": [1, 2, 3, 4], "b": [5, 6, 7, 8]})
for item in df.itertuples():
a = item.a
b = item.b
mypy.....................................................................Failed
- hook id: mypy
- exit code: 1
foo.py:6: error: "tuple[Any, ...]" has no attribute "a" [attr-defined]
foo.py:7: error: "tuple[Any, ...]" has no attribute "b" [attr-defined]
Found 2 errors in 1 file (checked 1 source file)
Metadata
Metadata
Assignees
Labels
No labels