Closed
Description
Describe the bug
Series.mean()
is typed as float, but actually returns a numpy.float64
.
This errors because I need to call .item()
to get the actual float.
To Reproduce
# pyright: strict
import pandas as pd
mean = pd.Series([1, 2, 3, 4]).mean()
print(type(mean)) # numpy.float64 instead of float
mean.item() # Cannot access member "item" for type "float" Member "item" is unknown Pylance (reportGeneralTypeIssues)
Please complete the following information:
- OS: Linux
- OS Version 20.04
- python 3.8.10
- version of type checker: 1.1.293
- version of installed
pandas-stubs
: Pylance v2023.2.31
Additional context
I must have the actual float for yaml.safe_dump
.
Metadata
Metadata
Assignees
Labels
No labels