MCPcopy
hub / github.com/pandas-dev/pandas / setup

Method setup

asv_bench/benchmarks/indexing.py:34–44  ·  view source on GitHub ↗
(self, dtype, index_structure)

Source from the content-addressed store, hash-verified

32 param_names = ["dtype", "index_structure"]
33
34 def setup(self, dtype, index_structure):
35 N = 10**6
36 indices = {
37 "unique_monotonic_inc": Index(range(N), dtype=dtype),
38 "nonunique_monotonic_inc": Index(
39 [*list(range(55)), 54, *list(range(55, N - 1))], dtype=dtype
40 ),
41 }
42 self.data = Series(np.random.rand(N), index=indices[index_structure])
43 self.array = np.arange(10000)
44 self.array_list = self.array.tolist()
45
46 def time_getitem_scalar(self, index, index_structure):
47 self.data[800000]

Callers

nothing calls this directly

Calls 3

IndexClass · 0.90
SeriesClass · 0.90
tolistMethod · 0.45

Tested by

no test coverage detected