Pandas version checks
-
[x] I have checked that this issue has not already been reported.
-
[x] 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
import numpy as np
df = pd.DataFrame(np.random.randn(100, 100))
%timeit df.stack(future_stack=False)
%timeit df.stack(future_stack=True)
242 μs ± 40.4 μs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)
25.6 ms ± 4.75 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
Installed Versions
INSTALLED VERSIONS
------------------
commit : c888af6d0bb674932007623c0867e1fbd4bdc2c6
python : 3.11.13
python-bits : 64
OS : Linux
OS-release : 4.18.0-553.36.1.el8_10.x86_64
Version : #1 SMP Wed Jan 22 03:07:54 EST 2025
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.3.1
numpy : 2.2.6
pytz : 2025.2
dateutil : 2.9.0.post0
pip : 25.1.1
Cython : None
sphinx : None
IPython : 9.4.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.13.4
blosc : None
bottleneck : 1.5.0
dataframe-api-compat : None
fastparquet : None
fsspec : 2025.7.0
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.6
lxml.etree : None
matplotlib : 3.10.3
numba : 0.61.2
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
psycopg2 : 2.9.10
pymysql : None
pyarrow : 20.0.0
pyreadstat : None
pytest : 8.4.1
python-calamine : None
pyxlsb : None
s3fs : 2025.7.0
scipy : 1.14.1
sqlalchemy : 2.0.41
tables : None
tabulate : 0.9.0
xarray : None
xlrd : None
xlsxwriter : None
zstandard : 0.23.0
tzdata : 2025.2
qtpy : None
pyqt5 : None
Prior Performance
No response
Comment From: mroeschke
Thanks, the performance issue should be addressed once 3.0 comes out xref https://github.com/pandas-dev/pandas/pull/58817