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
test_df = pd.DataFrame([{'a': 1378774140726870442}], dtype=np.int64)

print(test_df['a'].isin([np.uint64(1378774140726870528)])[0])
#True

Issue Description

The latest version of Pandas fixes the implicit conversion to float64 only when dtypes are uint64 vs int64. Int64 vs uint64 needs also to be fixed.

Expected Behavior

import pandas as pd import numpy as np test_df = pd.DataFrame([{'a': 1378774140726870442}], dtype=np.int64)

print(test_df['a'].isin([np.uint64(1378774140726870528)])[0])

False

Installed Versions

INSTALLED VERSIONS ------------------ commit : 0691c5cf90477d3503834d983f69350f250a6ff7 python : 3.11.2 python-bits : 64 OS : Linux OS-release : 6.1.0-31-amd64 Version : #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07) machine : x86_64 processor : byteorder : little LC_ALL : None LANG : fr_FR.UTF-8 LOCALE : fr_FR.UTF-8 pandas : 2.2.3 numpy : 1.26.0 pytz : 2023.3.post1 dateutil : 2.8.2 pip : 23.0.1 Cython : 3.0.12 sphinx : None IPython : 8.17.2 adbc-driver-postgresql: None adbc-driver-sqlite : None bs4 : 4.12.2 blosc : None bottleneck : None dataframe-api-compat : None fastparquet : None fsspec : 2023.10.0 html5lib : None hypothesis : 6.131.0 gcsfs : None jinja2 : 3.1.2 lxml.etree : None matplotlib : 3.8.2 numba : None numexpr : None odfpy : None openpyxl : 3.1.2 pandas_gbq : None psycopg2 : None pymysql : None pyarrow : 14.0.1 pyreadstat : None pytest : 8.3.5 python-calamine : None pyxlsb : None s3fs : 2023.10.0 scipy : 1.11.4 sqlalchemy : None tables : None tabulate : None xarray : None xlrd : None xlsxwriter : None zstandard : None tzdata : 2023.3 qtpy : None pyqt5 : None

Comment From: pbrochart

take