import random
vec_array = []
for x in range(100):
row = [random.randint(0,10), random.randint(0,10), random.randint(0,10)]
print(row)
vec_array.append(row)
print(vec_array)
I'm not sure what you mean by "array that is saved". You're exporting this array somewhere? To save this array in JSON, you could use:
import json
with open('output.json','w+') as f:
json.dump({'vec_array':vec_array},f)
To load that data again, you would simply run:
import json
with open('output.json') as f:
vec_array = json.load(f)['vec_array']
Further reading:
https://docs.python.org/3/library/json.html
For much larger datasets, a SQL database would be suitable:
https://docs.python.org/3/library/sqlite3.html
If you are certain you wish to use HDF5, you will have to resize your dataset if you pass the maximum size.
https://docs.h5py.org/en/stable/high/dataset.html#reading-writing-data
https://docs.h5py.org/en/stable/high/dataset.html#resizable-datasets