PERF: selection inside a row using a list of labels 30 slower than selection by the same individual labels #60203
Labels
Closing Candidate
May be closeable, needs more eyeballs
Indexing
Related to indexing on series/frames, not to indexes themselves
Performance
Memory or execution speed performance
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this issue exists on the latest version of pandas.
I have confirmed this issue exists on the main branch of pandas.
Reproducible Example
The code below accesses two columns either together or separately:
Output:
Using
iloc
does not suffer the same issue. Replace:Output:
Installed Versions
INSTALLED VERSIONS
commit : 0691c5c
python : 3.11.7
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.26100
machine : AMD64
processor : AMD64 Family 23 Model 49 Stepping 0, AuthenticAMD
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : English_Germany.1252
pandas : 2.2.3
numpy : 1.26.3
pytz : 2024.1
dateutil : 2.8.2
pip : 24.0
Cython : None
sphinx : 8.1.3
IPython : 8.22.1
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
blosc : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2024.2.0
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.2
lxml.etree : 4.9.4
matplotlib : 3.8.3
numba : 0.59.0
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : 14.0.2
pyreadstat : None
pytest : 8.2.0
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.12.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
Prior Performance
No response
The text was updated successfully, but these errors were encountered: