How can I determine the size (in bytes) of a PyTables Array?
Asked
Active
Viewed 118 times
3 Answers
1
Its not straight forward to do, but one thing you can do is to pickle the object and then determine the size of the serialized object. See this post
Community
- 1
- 1
reptilicus
- 10,203
- 6
- 51
- 75
1
It turns out that since all PyTables arrays are simply Numpy arrays underneath, you can do the following:
MyPytableFile.root.myPytableArray[:].nbytes
ChaimKut
- 2,897
- 3
- 37
- 60
0
Why not
arrSizeInBytes = arr.nrows * arr.rowsize
At least it equals to the results of
./h5ls -r -v pytables.db | grep "Dataset\|Storage"
Zinovy Nis
- 435
- 6
- 9