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

Method setup

asv_bench/benchmarks/sparse.py:72–82  ·  view source on GitHub ↗
(self, sort_labels)

Source from the content-addressed store, hash-verified

70 param_names = ["sort_labels"]
71
72 def setup(self, sort_labels):
73 s = Series([np.nan] * 10000)
74 s[0] = 3.0
75 s[100] = -1.0
76 s[999] = 12.1
77
78 s_mult_lvl = s.set_axis(MultiIndex.from_product([range(10)] * 4))
79 self.ss_mult_lvl = s_mult_lvl.astype("Sparse")
80
81 s_two_lvl = s.set_axis(MultiIndex.from_product([range(100)] * 2))
82 self.ss_two_lvl = s_two_lvl.astype("Sparse")
83
84 def time_sparse_series_to_coo(self, sort_labels):
85 self.ss_mult_lvl.sparse.to_coo(

Callers

nothing calls this directly

Calls 4

set_axisMethod · 0.95
SeriesClass · 0.90
from_productMethod · 0.80
astypeMethod · 0.45

Tested by

no test coverage detected