(self, length, num_blocks, block_size, fill_value)
| 142 | ) |
| 143 | |
| 144 | def make_block_array(self, length, num_blocks, block_size, fill_value): |
| 145 | arr = np.full(length, fill_value) |
| 146 | indices = np.random.choice( |
| 147 | np.arange(0, length, block_size), num_blocks, replace=False |
| 148 | ) |
| 149 | for ind in indices: |
| 150 | arr[ind : ind + block_size] = np.random.randint(0, 100, block_size) |
| 151 | return SparseArray(arr, fill_value=fill_value) |
| 152 | |
| 153 | def time_make_union(self, fill_value): |
| 154 | self.arr1.sp_index.make_union(self.arr2.sp_index) |