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

Method setup

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

Source from the content-addressed store, hash-verified

147
148class SparseIndex:
149 def setup(self):
150 NUM_ROWS = 1000
151 self.df = DataFrame(
152 {
153 "A": np.random.randint(50, size=NUM_ROWS),
154 "B": np.random.randint(50, size=NUM_ROWS),
155 "C": np.random.randint(-10, 10, size=NUM_ROWS),
156 "D": np.random.randint(-10, 10, size=NUM_ROWS),
157 "E": np.random.randint(10, size=NUM_ROWS),
158 "F": np.random.randn(NUM_ROWS),
159 }
160 )
161 self.df = self.df.set_index(["A", "B", "C", "D", "E"])
162
163 def time_unstack(self):
164 self.df.unstack()

Callers

nothing calls this directly

Calls 2

DataFrameClass · 0.90
set_indexMethod · 0.80

Tested by

no test coverage detected