Pandas version checks
-
[X] I have checked that this issue has not already been reported.
-
[X] I have confirmed this bug exists on the latest version of pandas.
-
[ ] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
import pandas as pd
data = {'col1': [1, 3, 4], 'col2': [2, 3, 5], 'col2': [2, 4, 4]}
df = pd.DataFrame(data)
df.dropna(subset=df.columns.drop('col1'))
Issue Description
https://github.com/pandas-dev/pandas/blob/91111fd99898d9dcaa6bf6bedb662db4108da6e6/pandas/core/frame.py#L6413-L6573
Expected Behavior
IndexLabel | None
might should be any array like object.
A similar issue: https://github.com/pandas-dev/pandas/issues/48098
Installed Versions
Comment From: phofl
Hi,
Thanks for your report. Are you using our stubs? If yes, this should go there too
Comment From: stevenlis
I don't say it in my conda list, so i guess no?
Comment From: rhshadrach
The screenshot looks like VS code, I think that's what is using the stubs even if they aren't in your Python environment. cc @Dr-Irv
Comment From: Dr-Irv
The screenshot looks like VS code, I think that's what is using the stubs even if they aren't in your Python environment. cc @Dr-Irv
Yes, most likely. Microsoft bundles pandas-stubs
in their release. You can check that by hovering over dropna()
, then right-click and select "go to declaration" and it will pull up a PYI file somewhere in your pylance distribution dist/bundles/stubs/pandas/
. If that's the case, then this is an issue for the pandas-stubs
project.
If that's the case, please create the issue there.
Comment From: stevenlis
Thanks @rhshadrach @Dr-Irv Indeed it's pylance in vscode... and they do use pandas-stubs. @phofl could you transfer the issue to pandas-stubs?
Comment From: phofl
You have to open another issue in the stubs repo
Comment From: Dr-Irv
Closing this as it is handled in the pandas-stubs.