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

Method setup

asv_bench/benchmarks/rolling.py:307–318  ·  asv_bench/benchmarks/rolling.py::Groupby.setup
(self, method, window_kwargs)

Source from the content-addressed store, hash-verified

305 )
306
307 def setup(self, method, window_kwargs):
308 N = 1000
309 window, kwargs = window_kwargs
310 df = pd.DataFrame(
311 {
312 class="st">"A": [str(i) for i in range(N)] * 10,
313 class="st">"B": list(range(N)) * 10,
314 }
315 )
316 if isinstance(kwargs.get(class="st">"window", None), str):
317 df.index = pd.date_range(start=class="st">"1900-01-01", freq=class="st">"1min", periods=N * 10)
318 self.groupby_window = getattr(df.groupby(class="st">"A"), window)(**kwargs)
319
320 def time_method(self, method, window_kwargs):
321 getattr(self.groupby_window, method)()

Callers

nothing calls this directly

Calls 2

groupbyMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected