calculate ratio of sparsity in a numpy array `a`,np.isnan(a).sum() / np.prod(a.shape)