GCXS.maybe_densify

GCXS.maybe_densify(max_size=1000, min_density=0.25)[source]

Converts this GCXS array to a numpy.ndarray if not too costly. :param max_size: Maximum number of elements in output :type max_size: int :param min_density: Minimum density of output :type min_density: float

Returns

The dense array.

Return type

numpy.ndarray

See also

sparse.GCXS.todense

Converts to Numpy function without checking the cost.

sparse.COO.maybe_densify

The equivalent COO function.

Raises

ValueError – If the returned array would be too large.