Skip to content

BUG: Odd behavior of Index.searchsorted #63938

@bilichboris

Description

@bilichboris

Pandas version checks

  • I have checked that this issue has not already been reported.

  • 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 numpy as np
import pandas as pd

base = 2**53
s = pd.Series(np.array([base, base+1, base+2, base+3], dtype=np.int64))
value = pd.array([base+1, pd.NA], dtype="Int64")

res = s.searchsorted(value, side="left")
print(res) # [0,4]

Issue Description

The following is a quite strange behavior of Index.searchsorted.

Expected Behavior

It should either raise or output something like [1,4] or [1,NA].

Installed Versions

Details

INSTALLED VERSIONS

commit : 98ffe4c
python : 3.13.7
python-bits : 64
OS : Linux
OS-release : 6.18.6-200.fc43.x86_64
Version : #1 SMP PREEMPT_DYNAMIC Sun Jan 18 18:57:00 UTC 2026
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

pandas : 3.0.0+38.g98ffe4c45e
numpy : 2.3.5
dateutil : 2.9.0.post0
pip : 25.3
Cython : 3.2.4
sphinx : 9.1.0
IPython : 9.9.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.14.3
bottleneck : 1.6.0
fastparquet : 2025.12.0
fsspec : 2026.1.0
html5lib : 1.1
hypothesis : 6.151.2
gcsfs : 2026.1.0
jinja2 : 3.1.6
lxml.etree : 6.0.2
matplotlib : 3.10.8
numba : 0.63.1
numexpr : 2.14.1
odfpy : None
openpyxl : 3.1.5
psycopg2 : 2.9.11
pymysql : 1.4.6
pyarrow : 23.0.0
pyiceberg : 0.10.0
pyreadstat : 1.3.3
pytest : 9.0.2
python-calamine : None
pytz : 2025.2
pyxlsb : 1.0.10
s3fs : 2026.1.0
scipy : 1.17.0
sqlalchemy : 2.0.46
tables : 3.10.2
tabulate : 0.9.0
xarray : 2025.12.0
xlrd : 2.0.2
xlsxwriter : 3.2.9
zstandard : 0.25.0
qtpy : None
pyqt5 : None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions