Skip to content

Instantly share code, notes, and snippets.

@voldern
Created October 22, 2019 09:43
Show Gist options
  • Save voldern/9fce3a83839c00e71242a5f0d1343f3a to your computer and use it in GitHub Desktop.
Save voldern/9fce3a83839c00e71242a5f0d1343f3a to your computer and use it in GitHub Desktop.
import numpy as np
import h5py
ADDRESS_COUNT = 100_000
BATCH_COUNT = 500
matrix = np.random.rand(ADDRESS_COUNT // BATCH_COUNT, ADDRESS_COUNT)
for i in range(BATCH_COUNT - 1):
print(f'Generating matrix {i} of {BATCH_COUNT}')
random_matrix = np.random.rand(ADDRESS_COUNT // BATCH_COUNT, ADDRESS_COUNT)
matrix = np.concatenate((matrix, random_matrix))
with h5py.File('random.hdf5', 'w') as f:
f.create_dataset('test', data=matrix)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment