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

Method setup

asv_bench/benchmarks/gil.py:91–107  ·  view source on GitHub ↗
(self, threads, method)

Source from the content-addressed store, hash-verified

89 param_names = ["threads", "method"]
90
91 def setup(self, threads, method):
92 N = 10**6
93 ngroups = 10**3
94 df = DataFrame(
95 {"key": np.random.randint(0, ngroups, size=N), "data": np.random.randn(N)}
96 )
97
98 @run_parallel(num_threads=threads)
99 def parallel():
100 getattr(df.groupby("key")["data"], method)()
101
102 self.parallel = parallel
103
104 def loop():
105 getattr(df.groupby("key")["data"], method)()
106
107 self.loop = loop
108
109 def time_parallel(self, threads, method):
110 self.parallel()

Callers

nothing calls this directly

Calls 1

DataFrameClass · 0.90

Tested by

no test coverage detected