def fill(self, datum, weight=1.0):
self._checkForCrossReferences()
if weight > 0.0:
q = self.quantity(datum)
if not isinstance(q, numbers.Real):
raise TypeError("function return value ({0}) must be boolean or number".format(q))
if self.nan(q):
self.nanflow.fill(datum, weight)
else:
b = self.bin(q)
if b not in self.bins:
self.bins[b] = self.value.copy()
self.bins[b].fill(datum, weight)
# no possibility of exception from here on out (for rollback)
self.entries += weight
评论列表
文章目录