We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d29244 commit f38baceCopy full SHA for f38bace
1 file changed
skgstat/Variogram.py
@@ -1990,11 +1990,11 @@ def _calc_groups(self, force=False):
1990
bin_edges = self.bins
1991
d = self.distance
1992
1993
- # -1 is the group fir distances outside maxlag
1994
- self._groups = np.ones(len(d), dtype=int) * -1
+ # use digitize for efficient binning
+ self._groups = np.digitize(d, bin_edges)
1995
1996
- for i, bounds in enumerate(zip([0] + list(bin_edges), bin_edges)):
1997
- self._groups[np.where((d >= bounds[0]) & (d < bounds[1]))] = i
+ # -1 is the group for distances outside maxlag
+ self._groups[self._groups == len(bin_edges)] = -1
1998
1999
def clone(self):
2000
"""Deep copy of self
0 commit comments