h5py/hdf5:
import numpy as np
import h5py
lol = np.empty((1200, 5000)).tolist()
f = h5py.File('big.hdf5', 'w')
bd = f.create_dataset('big_dataset', (len(lol), len(lol[0])), dtype='f')
bd[...] = lol
, bd, , , :
In [14]: bd[0, 1:10]
Out[14]:
array([ 0., 0., 0., 0., 0., 0., 0., 0., 0.], dtype=float32)
" " ( ).
abd = f.create_dataset('another_big_dataset', (len(lol), len(lol[0])), dtype='f')
abd[...] = lol
abd += 10
:
In [24]: abd[:3, :10]
Out[24]:
array([[ 10., 10., 10., 10., 10., 10., 10., 10., 10., 10.],
[ 10., 10., 10., 10., 10., 10., 10., 10., 10., 10.],
[ 10., 10., 10., 10., 10., 10., 10., 10., 10., 10.]], dtype=float32)
In [25]: bd[:3, :10]
Out[25]:
array([[ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
[ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]], dtype=float32)
, , , !
, , pytables, , h5py.
. :
Python Numpy
/ numpy, scipy SQLite HDF5