pandas-stubs
pandas-stubs copied to clipboard
Public type stubs for pandas
**Describe the bug** type annotation for Index/MultiIndex.names is incorrect **To Reproduce** 1. Provide a minimal runnable `pandas` example that is not properly checked by the stubs. ``` In [1]: import...
This is the list of things that are in pandas 2.0 release notes that need to be addressed in pandas-stubs. PR's welcome. If you do a PR, check off the...
**Describe the bug** When you do `DataFrame.to_dict(orient="index")`, and you are using default integer index and string columns, you will get a `Dict[int, Dict[str, Any]]` at runtime. The current annotations do...
Consider a DF or Series with a MultiIndex M1, M2, M3. When grouping as in `grp = df.groupby(level=["M1", "M3"])` You will get an error like ``` Argument of type "list[str]"...
**To Reproduce** ```python import pandas as pd x: pd.Series[int] = pd.Series([1, 3, 4], name="my series") assert isinstance(x, pd.Series) # this line produces the error below ``` mypy gives the following...
**Describe the bug** Instantiating an empty `Series` object creates a `TimestamptSeries`, should probably be `Series[Any]`. **To Reproduce** ```python from pandas import Series baz = Series([]) reveal_type(baz) # pandas.core.series.TimestampSeries ``` **Please...
I was using pylance to check types and the `date + BDay` stubs seems to be incorrect All 3 (`__rsub__`, `__add__`, `__radd__`) should return `pd.Timestamp`, but instead they are inferred...
**Describe the bug** `Series.mul` has incompatible signature with `Series.__mul__` **To Reproduce** ```python import pandas as pd import numpy as np s = pd.Series([1, 2, 3]) x = s * np.timedelta64(1,...
See comment #2 in https://github.com/microsoft/pyright/issues/5178#issuecomment-1566190533 > Some of the overloads for pd.Series.__new__ return types other than pd.Series (e.g. TimestampSeries, PeriodSeries). These other types appear nowhere within the pandas library. I...
**Describe the bug** The change in #721 broke this for mypy. Although the current docs say "one-parameter function, optional, default None", you are allowed to pass a string that specifies...