You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The return type for DataFrame/Series.squeeze is currently specified as Scalar, which is incomplete. According to the official documentation (pandas.DataFrame.squeeze and pandas.Series.squeeze), the correct return type should be DataFrame, Series, or scalar.
Describe the bug
The return type for DataFrame/Series.squeeze is currently specified as Scalar, which is incomplete. According to the official documentation (pandas.DataFrame.squeeze and pandas.Series.squeeze), the correct return type should be DataFrame, Series, or scalar.
Pandas documentation:
Admittedly how a series squeeze returns a DataFrame needs further investigation, but Series is definitely possible ;)
mypy error:
To Reproduce
Example test.py:
Run it, just to see the expected output (a series):
(.venv) ~/test-case $ python test.py 0 1 1 2 2 3 Name: A, dtype: int64
mypy expects a scalar:
versions:
Please complete the following information:
pandas-stubs
2.2.3.241126The text was updated successfully, but these errors were encountered: