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

CS-JCBE5roQ

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

INSTALLED VERSIONS ------------------ commit : 91111fd99898d9dcaa6bf6bedb662db4108da6e6 python : 3.9.12.final.0 python-bits : 64 OS : Darwin OS-release : 22.1.0 Version : Darwin Kernel Version 22.1.0: Sun Oct 9 20:15:52 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8112 machine : arm64 processor : arm byteorder : little LC_ALL : None LANG : None LOCALE : None.UTF-8 pandas : 1.5.1 numpy : 1.23.1 pytz : 2022.5 dateutil : 2.8.2 setuptools : 65.5.0 pip : 22.3 Cython : None pytest : None hypothesis : None sphinx : None blosc : None feather : None xlsxwriter : None lxml.etree : None html5lib : None pymysql : None psycopg2 : None jinja2 : 3.1.2 IPython : 8.5.0 pandas_datareader: None bs4 : 4.11.1 bottleneck : 1.3.5 brotli : fastparquet : None fsspec : None gcsfs : None matplotlib : 3.6.1 numba : None numexpr : 2.8.3 odfpy : None openpyxl : None pandas_gbq : None pyarrow : None pyreadstat : None pyxlsb : None s3fs : None scipy : 1.9.3 snappy : None sqlalchemy : None tables : None tabulate : 0.8.10 xarray : None xlrd : None xlwt : None zstandard : None tzdata : None

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? CS-1Llozygc

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.