We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4a38e5 commit 2abc9a9Copy full SHA for 2abc9a9
asv_bench/benchmarks/indexing.py
@@ -399,12 +399,14 @@ class ChainIndexing:
399
400
def setup(self, mode):
401
self.N = 1000000
402
+ self.df = DataFrame({"A": np.arange(self.N), "B": "foo"})
403
404
def time_chained_indexing(self, mode):
405
+ df = self.df
406
+ N = self.N
407
with warnings.catch_warnings(record=True):
408
with option_context("mode.chained_assignment", mode):
- df = DataFrame({"A": np.arange(self.N), "B": "foo"})
- df2 = df[df.A > self.N // 2]
409
+ df2 = df[df.A > N // 2]
410
df2["C"] = 1.0
411
412
0 commit comments