سؤال

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

هل كانت مفيدة؟

المحلول 2

It turns out that since all PyTables arrays are simply Numpy arrays underneath, you can do the following:

MyPytableFile.root.myPytableArray[:].nbytes

نصائح أخرى

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

Why not

arrSizeInBytes = arr.nrows * arr.rowsize

At least it equals to the results of

./h5ls -r -v pytables.db | grep "Dataset\|Storage"
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top