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

Method setup

asv_bench/benchmarks/multiindex_object.py:88–128  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

86
87class Integer:
88 def setup(self):
89 self.mi_int = MultiIndex.from_product(
90 [np.arange(1000), np.arange(1000)], names=["one", "two"]
91 )
92 self.obj_index = np.array(
93 [
94 (0, 10),
95 (0, 11),
96 (0, 12),
97 (0, 13),
98 (0, 14),
99 (0, 15),
100 (0, 16),
101 (0, 17),
102 (0, 18),
103 (0, 19),
104 ],
105 dtype=object,
106 )
107 self.other_mi_many_mismatches = MultiIndex.from_tuples(
108 [
109 (-7, 41),
110 (-2, 3),
111 (-0.7, 5),
112 (0, 0),
113 (0, 1.5),
114 (0, 340),
115 (0, 1001),
116 (1, -4),
117 (1, 20),
118 (1, 1040),
119 (432, -5),
120 (432, 17),
121 (439, 165.5),
122 (998, -4),
123 (998, 24065),
124 (999, 865.2),
125 (999, 1000),
126 (1045, -843),
127 ]
128 )
129
130 def time_get_indexer(self):
131 self.mi_int.get_indexer(self.obj_index)

Callers

nothing calls this directly

Calls 3

from_productMethod · 0.80
arrayMethod · 0.45
from_tuplesMethod · 0.45

Tested by

no test coverage detected