Skip to content

Commit 79410b7

Browse files
fixing bug with nan values
1 parent a704411 commit 79410b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rastermap/rastermap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ def fit(self, data=None, Usv=None, Vsv=None, U_nodes=None, itrain=None,
339339
self.sv = np.nansum((self.Usv**2), axis=0)**0.5
340340
if not hasattr(self, "Vsv"):
341341
if Vsv is None:
342-
U = self.Usv.copy() / self.sv
343-
self.Vsv = X.T @ U
342+
U = self.Usv[igood].copy() / self.sv
343+
self.Vsv = X[igood].T @ U
344344
elif Vsv is not None:
345345
self.Vsv = Vsv
346346

@@ -491,7 +491,7 @@ def fit(self, data=None, Usv=None, Vsv=None, U_nodes=None, itrain=None,
491491
if (bin_size==0 or n_samples < bin_size or
492492
(bin_size == 50 and n_samples < 1000)):
493493
bin_size = max(1, n_samples // 500)
494-
self.X_embedding = zscore(bin1d(X[igood][self.isort], bin_size, axis=0), axis=1)
494+
self.X_embedding = zscore(bin1d(X[self.isort], bin_size, axis=0), axis=1)
495495

496496
rmap_logger.info(f"rastermap complete, time {time.time() - t0:0.2f}sec")
497497

0 commit comments

Comments
 (0)