MCPcopy
hub / github.com/pydata/xarray / setup

Method setup

asv_bench/benchmarks/unstacking.py:10–14  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

8
9class Unstacking:
10 def setup(self):
11 data = np.random.default_rng(0).random((250, 500))
12 self.da_full = xr.DataArray(data, dims=list("ab")).stack(flat_dim=[...])
13 self.da_missing = self.da_full[:-1]
14 self.df_missing = self.da_missing.to_pandas()
15
16 def time_unstack_fast(self):
17 self.da_full.unstack("flat_dim")

Callers 1

setupMethod · 0.45

Calls 2

stackMethod · 0.45
to_pandasMethod · 0.45

Tested by

no test coverage detected