Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getBucketIndices(self, x):
- """ See method description in base.py """
- if ((isinstance(x, float) and math.isnan(x)) or
- x == SENTINEL_VALUE_FOR_MISSING_DATA):
- return [None]
- if self._offset is None:
- self._offset = x
- bucketIdx = (
- (self._maxBuckets/2) + int(round((x - self._offset) / self.resolution))
- )
- if bucketIdx < 0:
- bucketIdx = 0
- elif bucketIdx >= self._maxBuckets:
- bucketIdx = self._maxBuckets-1
- return [bucketIdx]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement