Merge branch 'cat_fix' of https://github.com/dwillmer/pandas into cat… · rs2/pandas@21a35a0 (original) (raw)
70 files changed
lines changed
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| 1 | +from itertools import repeat | |
| 2 | + | |
| 1 | 3 | from .pandas_vb_common import * |
| 2 | 4 | import scipy.sparse |
| 3 | 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)) |
| 29 | 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 | + | |
| 30 | 38 | |
| 31 | 39 | class sparse_series_from_coo(object): |
| 32 | 40 | goal_time = 0.2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -114,7 +114,7 @@ def translate_module(target_module): | ||
| 114 | 114 | l_vars = {} |
| 115 | 115 | exec('import ' + target_module) in g_vars |
| 116 | 116 | |
| 117 | -print target_module | |
| 117 | +print(target_module) | |
| 118 | 118 | module = eval(target_module, g_vars) |
| 119 | 119 | |
| 120 | 120 | benchmarks = [] |
| @@ -157,7 +157,7 @@ def translate_module(target_module): | ||
| 157 | 157 | mod = os.path.basename(module) |
| 158 | 158 | if mod in ['make.py', 'measure_memory_consumption.py', 'perf_HEAD.py', 'run_suite.py', 'test_perf.py', 'generate_rst_files.py', 'test.py', 'suite.py']: |
| 159 | 159 | continue |
| 160 | ||
| 161 | -print mod | |
| 160 | +print('') | |
| 161 | +print(mod) | |
| 162 | 162 | |
| 163 | 163 | translate_module(mod.replace('.py', '')) |