We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0b468f commit f41b490Copy full SHA for f41b490
asv_bench/benchmarks/sparse.py
@@ -1,3 +1,5 @@
1
+from itertools import repeat
2
+
3
from .pandas_vb_common import *
4
import scipy.sparse
5
from pandas import SparseSeries, SparseDataFrame
@@ -27,6 +29,12 @@ class sparse_frame_constructor(object):
27
29
def time_sparse_frame_constructor(self):
28
30
SparseDataFrame(columns=np.arange(100), index=np.arange(1000))
31
32
+ def time_sparse_from_scipy(self):
33
+ SparseDataFrame(scipy.sparse.rand(1000, 1000, 0.005))
34
35
+ def time_sparse_from_dict(self):
36
+ SparseDataFrame(dict(zip(range(1000), repeat([0]))))
37
38
39
class sparse_series_from_coo(object):
40
goal_time = 0.2
0 commit comments