data = {"col_0": [9, -3, 0, -1, 5], "col_1": [-2, -7, 6, 8, -5]}
df = pd.DataFrame(data)
t = pd.Series([2, -4, -1, 6, 3])
df.clip(t, t + 4, axis=0)
2. Pyright 1.1.373
3.
Argument of type "Series[int]" cannot be assigned to parameter "upper" of type "float | None" in function "clip"
Type "Series[int]" is incompatible with type "float | None"
"Series[int]" is incompatible with "float"
"Series[int]" is incompatible with "None"PylancereportArgumentType
**Please complete the following information:**
- OS: Windows 11
- OS Version 23H2
- python version 3.12.2
- version of type checker: Pyright 1.1.373
- version of installed `pandas-stubs`: 2.2.2.240807
Describe the bug Hi,
There is an inconsistency with Pandas's doc regarding
clip
. This was already fixed for Series in #443, but not for DataFramehttps://github.com/pandas-dev/pandas-stubs/blob/2acc94d60c63484d9b664b8e68aa213a4d39b937/pandas-stubs/core/frame.pyi#L1633-L1641
To Reproduce
data = {"col_0": [9, -3, 0, -1, 5], "col_1": [-2, -7, 6, 8, -5]} df = pd.DataFrame(data) t = pd.Series([2, -4, -1, 6, 3]) df.clip(t, t + 4, axis=0)
Argument of type "Series[int]" cannot be assigned to parameter "upper" of type "float | None" in function "clip" Type "Series[int]" is incompatible with type "float | None" "Series[int]" is incompatible with "float" "Series[int]" is incompatible with "None"PylancereportArgumentType