SyntaxFix
Write A Post
Hire A Developer
Questions
To determine if the array is sparse, it may help to get a proportion of nan values
np.isnan(ndarr).sum() / ndarr.size
If that proportion exceeds a threshold, then use a sparse array, e.g. - https://sparse.pydata.org/en/latest/