About the distinction between DataArray.nbytes
and Dataset.nbytes
#9073
Unanswered
etienneschalk
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
About the distinction between
DataArray.nbytes
andDataset.nbytes
I have a question about the current
nbytes
that is represented, inherited from a distinction betweenDataArray.nbytes
andDataset.nbytes
:DataArray
, only thenbytes
of the data itself is taken into account (without coordinates)Dataset
, all data variables and coordinates variables contribute to the size.Examples: First I build a DataArray where the coordinates (
float64
) weigh more than the actual data (uint8
). The top-levelSize: 3B
is shown. Then I place it into a Dataset. NowSize: 27B
is shown. This different way of counting is inherited from the direct usage of.nbytes
. I find it a bit confusing because theDataArray
andDataset
contain the same data, but presented differently.The documentation is clear about it:
But still, is there any reason for this variation? Why excluding coordinates for DataArrays and not for Datasets?
Thanks!
code examples below ⬇️
Beta Was this translation helpful? Give feedback.
All reactions