-
-
Notifications
You must be signed in to change notification settings - Fork 155
Labels
Numeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operationsSeriesSeries data structureSeries data structure
Description
Describe the bug
In many use cases, I have seen code extracting a column from a dataframe then adding a string.
In the current setup this is now barred but I believe we should be a little lenient when it comes to not being too strict since the types can't be inferred from a dataframe when selecting a column.
To Reproduce
- Provide a minimal runnable
pandasexample that is not properly checked by the stubs. - Indicate which type checker you are using (
mypyorpyright). - Show the error message received from that type checker while checking your example.
import pandas as pd
df = pd.Series(["a", "b"]).to_frame()
df[0] + "c3" # Operator "+" not supported for types "Series[Any]" and "Literal['c3']" [repor│Please complete the following information:
- OS: MacOS
- OS Version [e.g. 22]
- python version 3.14
- version of type checker 1.19
- version of installed
pandas-stubsmain
Additional context
Add any other context about the problem here.
cmp0xff
Metadata
Metadata
Assignees
Labels
Numeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operationsSeriesSeries data structureSeries data structure