Skip to content

Commit 2324563

Browse files
committed
ENH: Move iloc operation to setup method.
1 parent a885a5d commit 2324563

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

asv_bench/benchmarks/plotting.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,17 @@ def setup(self, size, datetime_index):
189189
np.random.randn(rows, cols),
190190
columns=[f"col_{i}" for i in range(cols)]
191191
)
192+
193+
# Pre-select single column for baseline comparison
194+
self.single_column = self.df.iloc[:, 0]
192195

193196
def time_plot_large_dataframe(self, size, datetime_index):
194197
"""Benchmark plotting large DataFrames (bottleneck #61398/#61532)"""
195198
self.df.plot()
196199

197200
def time_plot_large_dataframe_single_column(self, size, datetime_index):
198201
"""Baseline: plotting single column for comparison"""
199-
self.df.iloc[:, 0].plot()
202+
self.single_column.plot()
200203

201204

202205
from .pandas_vb_common import setup # noqa isort:skip

0 commit comments

Comments
 (0)