Open cmp0xff opened 6 days ago
First, your example is not correct. It should be:
import pandas as pd
df = pd.DataFrame({1: [2], 3: [4]}) # Fix is here
df = df.drop(columns={1})
Secondly, the pandas documentation says that the argument for columns
is "single label or list-like". While your code works, it is not clear that it should. The stubs follows what is documented and a set is not "list-like".
I've added a reference to a pandas issue https://github.com/pandas-dev/pandas/issues/59890 to see what the pandas developers say there.
Describe the bug
DataFrame.drop
withcolumns=set(...)
is unspecified.To Reproduce
Provide a minimal runnable
pandas
example that is not properly checked by the stubs.mypy
type checker.Please complete the following information
Python 3.11.9
mypy 1.11.2 (compiled: yes)
pandas-stubs
:pandas-stubs==2.2.2.240807
Additional context
Nope