(total_size, nchunks, ncols, dtype=np.dtype('int64'))
| 24 | |
| 25 | |
| 26 | def generate_chunks(total_size, nchunks, ncols, dtype=np.dtype('int64')): |
| 27 | rowsize = total_size // nchunks // ncols |
| 28 | assert rowsize % dtype.itemsize == 0 |
| 29 | |
| 30 | def make_column(col, chunk): |
| 31 | return np.frombuffer(common.get_random_bytes( |
| 32 | rowsize, seed=col + 997 * chunk)).view(dtype) |
| 33 | |
| 34 | return [pd.DataFrame({ |
| 35 | 'c' + str(col): make_column(col, chunk) |
| 36 | for col in range(ncols)}) |
| 37 | for chunk in range(nchunks)] |
| 38 | |
| 39 | |
| 40 | class StreamReader(object): |
no test coverage detected