CLAUDE
CLAUDE

Reputation: 323

Is it good to use scipy sparse data structure for non-sparse matrices?

Using scipy.sparse is very efficient both in storing and doing computations on sparse matrices. What if it is used for non-sparse matrices? More specifically, It is clear that we cannot exploit the sparsity benefits of that data structure, however, is it worse (in storage and computation complexity) than using an ordinary numpy array?

Upvotes: 0

Views: 100

Answers (1)

ev-br
ev-br

Reputation: 26030

Yes, it is worse in both storage and performance, let alone cognitive load for whoever reads your code.

Upvotes: 1

Related Questions