Closed
Description
Describe the bug
Per the docs name
is:
The name of the returned namedtuples or None to return regular tuples.
But this repo only gives:
pandas-stubs/pandas-stubs/core/frame.pyi
Lines 249 to 251 in 56eafc1
Where:
pandas-stubs/pandas-stubs/core/frame.pyi
Lines 2276 to 2277 in 56eafc1
To Reproduce
df = DataFrame({'num_legs': [4, 2], 'num_wings': [0, 2]},
index=['dog', 'hawk'])
tuples: Iterable[tuple[int, int]] = df.itertuples(name=None)
Pyright:
Expression of type "Iterable[_PandasNamedTuple]" cannot be assigned to declared type "Iterable[tuple[int, int]]"
"Iterable[_PandasNamedTuple]" is incompatible with "Iterable[tuple[int, int]]"
Type parameter "_T_co@Iterable" is covariant, but "_PandasNamedTuple" is not a subtype of "tuple[int, int]"
"_PandasNamedTuple" is incompatible with "tuple[int, int]"
Tuple size mismatch; expected 2 but received indeterminatePylance[reportGeneralTypeIssues](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportGeneralTypeIssues)
Please complete the following information:
- OS: Ubuntu 20.04.6 LTS
- python 3.11.4
- pyright v1.1.347
- pandas-stubs 2.1.4.231227
Additional context
Also notable that the actual returned type is either map
or zip
for name
Pandas
or None
respectively.
Metadata
Metadata
Assignees
Labels
No labels