WLJS LogoWLJS Notebook

SparseArrayQ

SparseArrayQ[s] yields True if s is a valid SparseArray object and False otherwise.

Examples

Test a sparse array:

SparseArrayQ[SparseArray[{1, 0, 0, 2}]]
(* True *)

Test a regular list:

SparseArrayQ[{1, 0, 0, 2}]
(* False *)

Please visit the official Wolfram Language Reference for more details.

On this page