diff --git a/uproot/write/objects/TH.py b/uproot/write/objects/TH.py index 298b3c90..c86fa62f 100644 --- a/uproot/write/objects/TH.py +++ b/uproot/write/objects/TH.py @@ -74,7 +74,7 @@ def __init__(self, histogram): else: raise ValueError("unrecognized histogram class name {0}".format(self.fClassName)) - self.fields["_fNcells"] = len(self.valuesarray) + self.fields["_fNcells"] = self.valuesarray.size self.fields["_fContour"] = numpy.array(self.fields["_fContour"], dtype=">f8", copy=False) self.fields["_fSumw2"] = numpy.array(self.fields["_fSumw2"], dtype=">f8", copy=False)