Skip to content

Commit fca1f7c

Browse files
authored
BENCH: Fix misleading Interpolate asv (#42956)
1 parent 965d289 commit fca1f7c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

asv_bench/benchmarks/frame_methods.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,12 @@ class Interpolate:
538538
def setup(self, downcast):
539539
N = 10000
540540
# this is the worst case, where every column has NaNs.
541-
self.df = DataFrame(np.random.randn(N, 100))
542-
self.df.values[::2] = np.nan
541+
arr = np.random.randn(N, 100)
542+
# NB: we need to set values in array, not in df.values, otherwise
543+
# the benchmark will be misleading for ArrayManager
544+
arr[::2] = np.nan
545+
546+
self.df = DataFrame(arr)
543547

544548
self.df2 = DataFrame(
545549
{

0 commit comments

Comments
 (0)