0

How can I determine the size (in bytes) of a PyTables Array?

ChaimKut
  • 2,759
  • 3
  • 38
  • 64

3 Answers3

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,290
  • 6
  • 55
  • 79
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,759
  • 3
  • 38
  • 64
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
  • 455
  • 6
  • 9