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.

  • [x] I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd
import numpy as np
from pandas.api.types import infer_dtype

print(infer_dtype([1 + 1j, np.nan]))
# complex
print(infer_dtype([1 + 1j, pd.NA]))
# mixed

Issue Description

infer_dtype on complex arrays with NA does not produce consistent results. Similar to #61621, which has been fixed for the case of float type. I will submit a PR.

Expected Behavior

Should return complex.

Installed Versions

INSTALLED VERSIONS ------------------ commit : 49ca01ba9023b677f2b2d1c42e99f45595258b74 python : 3.10.16 python-bits : 64 OS : Linux OS-release : 5.10.16.3-microsoft-standard-WSL2 Version : #1 SMP Fri Apr 2 22:23:49 UTC 2021 machine : x86_64 processor : x86_64 byteorder : little LC_ALL : None LANG : C.UTF-8 LOCALE : en_US.UTF-8 pandas : 3.0.0.dev0+1580.g68d9dcab5b.dirty numpy : 1.26.4 dateutil : 2.9.0.post0 pip : 24.3.1 Cython : 3.0.11 sphinx : 8.1.3 IPython : 8.31.0 adbc-driver-postgresql: None adbc-driver-sqlite : None bs4 : 4.12.3 bottleneck : 1.4.2 fastparquet : 2024.11.0 fsspec : 2024.12.0 html5lib : 1.1 hypothesis : 6.124.7 gcsfs : 2024.12.0 jinja2 : 3.1.5 lxml.etree : 5.3.0 matplotlib : 3.10.0 numba : 0.60.0 numexpr : 2.10.2 odfpy : None openpyxl : 3.1.5 psycopg2 : 2.9.9 pymysql : 1.4.6 pyarrow : 19.0.0 pyiceberg : None pyreadstat : 1.2.8 pytest : 8.3.4 python-calamine : None pytz : 2024.2 pyxlsb : 1.0.10 s3fs : 2024.12.0 scipy : 1.15.1 sqlalchemy : 2.0.37 tables : 3.10.1 tabulate : 0.9.0 xarray : 2024.9.0 xlrd : 2.0.1 xlsxwriter : 3.2.0 zstandard : 0.23.0 qtpy : None pyqt5 : None

Comment From: arthurlw

Confirmed on main. PRs are welcome!

Thanks for raising this!