From 6ecbaca95cebee432f3ae560f8f76bedc67b56ef Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Wed, 25 Sep 2024 13:26:48 +0100 Subject: [PATCH] Update fslite/fs/fdataframe.py Co-authored-by: codiumai-pr-agent-pro[bot] <151058649+codiumai-pr-agent-pro[bot]@users.noreply.github.com> --- fslite/fs/fdataframe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fslite/fs/fdataframe.py b/fslite/fs/fdataframe.py index 25a4dc3..1ca7910 100644 --- a/fslite/fs/fdataframe.py +++ b/fslite/fs/fdataframe.py @@ -109,7 +109,7 @@ def __init__( # Check sparsity num_elements = numerical_df.size - num_zeros = (numerical_df == 0).sum().sum() + num_zeros = np.count_nonzero(numerical_df == 0) sparsity = num_zeros / num_elements dense_matrix_size = numerical_df.memory_usage(deep=True).sum() # In bytes