Skip to content

Commit

Permalink
fix: convert sparse numpy matrix to ndarray (#2271)
Browse files Browse the repository at this point in the history
  • Loading branch information
seve authored Jul 6, 2021
1 parent f55c726 commit 5f976cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/czi_hosted/data_common/data_adaptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def summarize_var(self, method, filter, query_hash):
else:
X = self.get_X_array(obs_selector, var_selector)
if sparse.issparse(X):
mean = X.mean(axis=1)
mean = X.mean(axis=1).A
else:
mean = X.mean(axis=1, keepdims=True)

Expand Down
2 changes: 1 addition & 1 deletion backend/server/data_common/data_adaptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def summarize_var(self, method, filter, query_hash):
else:
X = self.get_X_array(obs_selector, var_selector)
if sparse.issparse(X):
mean = X.mean(axis=1)
mean = X.mean(axis=1).A
else:
mean = X.mean(axis=1, keepdims=True)

Expand Down

0 comments on commit 5f976cc

Please sign in to comment.