When an operation reduces the number of dimensions to zero, numpy returns a numpy scalar object:
In : a = rand(10,10,10)
In : a.sum()
In : _34.ndim
In : _34.shape
For datarray, we can return scalars, but they will be plain numpy scalars, they won't have the extra datarray-specific fields (like labels, axes, ...). We can't add new fields to numpy scalars:
In : _34.newfield=1
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'numpy.float64' object has no attribute 'newfield'
So this is not likely to change soon, but we want to record it here for later reference. If datarray is included in numpy, it may be easier to play with the scalar code to make datarray scalars have all the necessary fields.