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

Method setup

asv_bench/benchmarks/sparse.py:22–31  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

20
21class SparseSeriesToFrame:
22 def setup(self):
23 K = 50
24 N = 50001
25 rng = date_range("1/1/2000", periods=N, freq="min")
26 self.series = {}
27 for i in range(1, K):
28 data = np.random.randn(N)[:-i]
29 idx = rng[:-i]
30 data[100:] = np.nan
31 self.series[i] = Series(SparseArray(data), index=idx)
32
33 def time_series_to_frame(self):
34 pd.DataFrame(self.series)

Callers

nothing calls this directly

Calls 3

date_rangeFunction · 0.90
SeriesClass · 0.90
SparseArrayClass · 0.90

Tested by

no test coverage detected