@@ -38,13 +38,13 @@ def _scale_normalize(X):
3838 row_diag = np .asarray (1.0 / np .sqrt (X .sum (axis = 1 )))
3939 if row_diag .shape [0 ] != 1 :
4040 row_diag = row_diag .squeeze ()
41-
41+
4242 col_diag = np .asarray (1.0 / np .sqrt (X .sum (axis = 0 )))
43- if col_diag .ndim == 1 and col_diag .shape [0 ]!= 1 :
43+ if col_diag .ndim == 1 and col_diag .shape [0 ] != 1 :
4444 col_diag = col_diag .squeeze ()
45- if col_diag .ndim == 2 and col_diag .shape [0 ] == 1 and col_diag . shape [ 1 ] != 1 :
45+ if col_diag .ndim == 2 and col_diag .shape [1 ] != 1 :
4646 col_diag = col_diag .squeeze ()
47-
47+
4848 row_diag = np .where (np .isnan (row_diag ), 0 , row_diag )
4949 col_diag = np .where (np .isnan (col_diag ), 0 , col_diag )
5050
@@ -296,7 +296,7 @@ def _fit(self, X):
296296
297297 z = np .vstack ((row_diag [:, np .newaxis ] * u ,
298298 col_diag [:, np .newaxis ] * v ))
299-
299+
300300 _ , labels = self ._k_means (z , self .n_clusters )
301301
302302 n_rows = X .shape [0 ]
@@ -493,7 +493,7 @@ def _fit(self, X):
493493 for _ in range (n_row_clusters )
494494 for label in range (n_col_clusters ))
495495 return self
496-
496+
497497 def _fit_best_piecewise (self , vectors , n_best , n_clusters ):
498498 """Find the ``n_best`` vectors that are best approximated by piecewise
499499 constant vectors.
0 commit comments