pandas-stubs icon indicating copy to clipboard operation
pandas-stubs copied to clipboard

Public type stubs for pandas

Results 88 pandas-stubs issues
Sort by recently updated
recently updated
newest added

**Describe the bug** The stubs for ExtensionArray (in `pandas-stubs/core/arrays/base.pyi`) does not provide type signatures for _accumulate and _reduce. To properly add typing information to the Pint-Pandas project, these need to...

good first issue
ExtensionArray

- [X] Closes https://github.com/pandas-dev/pandas/issues/58424 - [X] Tests added: Please use `assert_type()` to assert the type of any return value

I originally contributed the annotations for these methods in https://github.com/pandas-dev/pandas-stubs/pull/339. That PR has a bunch of context about how the fact that `TypeGuard` only narrows in the positive case, while...

**Describe the bug** Example from [the docs](https://pandas.pydata.org/pandas-docs/stable/development/extending.html#registering-custom-accessors) causes: ``` Untyped class decorator obscures type of class; ignoring decoratorPylance[reportUntypedClassDecorator](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportUntypedClassDecorator) ``` in VSCode. **To Reproduce** In VSCode: ```python @pd.api.extensions.register_dataframe_accessor("geo") class GeoAccessor: ......

**Describe the bug** Using [`pipe`](https://pandas.pydata.org/pandas-docs/stable/user_guide/basics.html#tablewise-function-application) returns a instance of the type pipe is called on, but the type stubs imply it's the type of the function being applied by pipe....

[series.pyi](https://github.com/pandas-dev/pandas-stubs/blob/main/pandas-stubs/core/series.pyi#L1379-L1388) contains overloads for most datetime like series and scalar values, but not for `DateOffset`, even though pandas appears to support it. In most cases `Timedelta` for offsetting a`Timestamp` series...

Frequency

In #862 a change was made to replace `Series[bool]` with `MaskType` for `.loc`. There are other places in the stubs where `Series[bool]` is used, and we should investigate which of...

**Describe the bug** Code that passed the output of itertuples to functions expecting `NamedTuple` fails in mypy with `incompatible type "_PandasNamedTuple"; expected "NamedTuple"` (Maybe related to the fix for issue...

**Describe the bug** A pd.Series variable changes type after an isinstance check. **To Reproduce** 1. Provide a minimal runnable `pandas` example that is not properly checked by the stubs. ```python...

mypy bug

**Describe the bug** Using ``` df = pd.DataFrame({"a": [1, 2, 3], "b": 1}) x: pd.DataFrame = df.groupby("a", as_index=False).value_counts() ``` raises an error, because mypy thinks the return is a Series...

Groupby