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

Method setup

asv_bench/benchmarks/reshape.py:239–246  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

237
238class Crosstab:
239 def setup(self):
240 N = 100000
241 fac1 = np.array(["A", "B", "C"], dtype="O")
242 fac2 = np.array(["one", "two"], dtype="O")
243 self.ind1 = np.random.randint(0, 3, size=N)
244 self.ind2 = np.random.randint(0, 2, size=N)
245 self.vec1 = fac1.take(self.ind1)
246 self.vec2 = fac2.take(self.ind2)
247
248 def time_crosstab(self):
249 pd.crosstab(self.vec1, self.vec2)

Callers

nothing calls this directly

Calls 2

arrayMethod · 0.45
takeMethod · 0.45

Tested by

no test coverage detected