- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 152
Open
Labels
Compatpandas objects compatability with Numpy or Python functionspandas objects compatability with Numpy or Python functionsSeriesSeries data structureSeries data structure
Description
Description
dtype of the resulting np_1darray from to_numpy does not reflect the typing of the Series
To Reproduce
Script
from typing import reveal_type
import pandas as pd
reveal_type(s := pd.Series([True]))  # Series[bool]
reveal_type(s.to_numpy())  # problem: np_1darray[Any]
reveal_type(s := pd.Series([1]))  # Series[int]
reveal_type(s.to_numpy())  # problem: np_1darray[Any]Indicate which type checker you are using (mypy or  pyright).
pyright
Messages from the type checker
Inline commented in the script
Please complete the following information
- version of type checker: 1.1.406
- version of installed pandas-stubs:main
Metadata
Metadata
Assignees
Labels
Compatpandas objects compatability with Numpy or Python functionspandas objects compatability with Numpy or Python functionsSeriesSeries data structureSeries data structure