Sparse

Latest version: v0.15.5

Safety actively analyzes 706267 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 3

0.6.0

------------------

This release breaks backward-compatibility. Previously, if arrays were fed into
NumPy functions, an attempt would be made to densify the array and apply the NumPy
function. This was unintended behaviour in most cases, with the array filling up
memory before raising a ``MemoryError`` if the array was too large.

We have now changed this behaviour so that a ``RuntimeError`` is now raised if
an attempt is made to automatically densify an array. To densify, use the explicit
``.todense()`` method.

* Fixed a bug where ``np.matrix`` could sometimes fail to
convert to a ``COO``. (Issue [199](https://github.com/pydata/sparse/issues/199), PR [#200](https://github.com/pydata/sparse/pull/200)).
* Make sure that ``sparse sparse`` returns a sparse array. (Issue [201](https://github.com/pydata/sparse/issues/201), PR [#203](https://github.com/pydata/sparse/pull/203))
* Bring ``operator.matmul`` behaviour in line with NumPy for ``ndim > 2``.
(Issue [202](https://github.com/pydata/sparse/issues/202), PR [#204](https://github.com/pydata/sparse/pull/204), PR [#217](https://github.com/pydata/sparse/pull/217))
* Make sure ``dtype`` is preserved with the ``out`` kwarg. (Issue [205](https://github.com/pydata/sparse/issues/205), PR [#206](https://github.com/pydata/sparse/pull/206))
* Fix integer overflow in ``reduce`` on Windows. (Issue [207](https://github.com/pydata/sparse/issues/207), PR [#208](https://github.com/pydata/sparse/pull/208))
* Disallow auto-densification. (Issue [218](https://github.com/pydata/sparse/issues/218), PR [#220](https://github.com/pydata/sparse/pull/220))
* Add auto-densification configuration, and a configurable warning for checking
if the array is too dense. (PR [210](https://github.com/pydata/sparse/pull/210), PR [#213](https://github.com/pydata/sparse/pull/213))
* Add pruning of fill-values to COO constructor. (PR [221](https://github.com/pydata/sparse/pull/221))

0.5.0

------------------

* Added `COO.real`, `COO.imag`, and `COO.conj` (PR [196](https://github.com/pydata/sparse/pull/196)).
* Added `sparse.kron` function (PR [194](https://github.com/pydata/sparse/pull/194), PR [#195](https://github.com/pydata/sparse/pull/195)).
* Added `order` parameter to `COO.reshape` to make it work with
`np.reshape` (PR [193](https://github.com/pydata/sparse/pull/193)).
* Added `COO.mean` and `sparse.nanmean` (PR [190](https://github.com/pydata/sparse/pull/190)).
* Added `sparse.full` and `sparse.full_like` (PR [189](https://github.com/pydata/sparse/pull/189)).
* Added `COO.clip` method (PR [185](https://github.com/pydata/sparse/pull/185)).
* Added `COO.copy` method, and changed pickle of `COO` to not
include its cache (PR [184](https://github.com/pydata/sparse/pull/184)).
* Added `sparse.eye`, `sparse.zeros`, `sparse.zeros_like`,
`sparse.ones`, and `sparse.ones_like` (PR [183](https://github.com/pydata/sparse/pull/183)).

0.4.1

------------------

* Allow mixed `ndarray`-`COO` operations if the result is sparse
(Issue [124](https://github.com/pydata/sparse/issues/124), via PR [#182](https://github.com/pydata/sparse/pull/182)).
* Allow specifying a fill-value when converting from NumPy arrays
(Issue [179](https://github.com/pydata/sparse/issues/179), via PR [#180](https://github.com/pydata/sparse/pull/180)).
* Added `COO.any` and `COO.all` methods (PR [175](https://github.com/pydata/sparse/pull/175)).
* Indexing for `COO` now accepts a single one-dimensional array index
(PR [172](https://github.com/pydata/sparse/pull/172)).
* The fill-value can now be something other than zero or `False`
(PR [165](https://github.com/pydata/sparse/pull/165)).
* Added a `sparse.roll` function (PR [160](https://github.com/pydata/sparse/pull/160)).
* Numba code now releases the GIL. This leads to better multi-threaded
performance in Dask (PR [159](https://github.com/pydata/sparse/pull/159)).
* A number of bugs occurred, so to resolve them, `COO.coords.dtype` is
always `np.int64`. `COO`, therefore, uses more memory than
before (PR [158](https://github.com/pydata/sparse/pull/158)).
* Add support for saving and loading `COO` files from disk (Issue [153](https://github.com/pydata/sparse/issues/153),
via PR [154](https://github.com/pydata/sparse/pull/154)).
* Support `COO.nonzero` and `np.argwhere` (Issue [145](https://github.com/pydata/sparse/issues/145), via
PR [148](https://github.com/pydata/sparse/pull/148)).
* Allow faux in-place operations (Issue [80](https://github.com/pydata/sparse/issues/80), via PR [#146](https://github.com/pydata/sparse/pull/146)).
* `COO` is now always canonical (PR [141](https://github.com/pydata/sparse/pull/141)).
* Improve indexing performance (PR [128](https://github.com/pydata/sparse/pull/128)).
* Improve element-wise performance (PR [127](https://github.com/pydata/sparse/pull/127)).
* Reductions now support a negative axis (Issue [117](https://github.com/pydata/sparse/issues/117), via PR [#118](https://github.com/pydata/sparse/pull/118)).
* Match behaviour of `ufunc.reduce` from NumPy (Issue [107](https://github.com/pydata/sparse/issues/107), via
PR [108](https://github.com/pydata/sparse/pull/108)).

0.3.1

------------------

* Fix packaging error (PR [138](https://github.com/pydata/sparse/pull/138)).

0.3.0

------------------

* Add NaN-skipping aggregations (PR [102](https://github.com/pydata/sparse/pull/102)).
* Add equivalent to `np.where` (PR [102](https://github.com/pydata/sparse/pull/102)).
* N-input universal functions now work (PR [98](https://github.com/pydata/sparse/pull/98)).
* Make `dot` more consistent with NumPy (PR [96](https://github.com/pydata/sparse/pull/96)).
* Create a base class `SparseArray` (PR [92](https://github.com/pydata/sparse/pull/92)).
* Minimum NumPy version is now 1.13 (PR [90](https://github.com/pydata/sparse/pull/90)).
* Fix a bug where setting a `DOK` element to zero did nothing
(Issue [93](https://github.com/pydata/sparse/issues/93), via PR [#94](https://github.com/pydata/sparse/pull/94)).

0.2.0

------------------

* Support faster `np.array(COO)` (PR [87](https://github.com/pydata/sparse/pull/87)).
* Add `DOK` type (PR [85](https://github.com/pydata/sparse/pull/85)).
* Fix sum for large arrays (Issue [82](https://github.com/pydata/sparse/issues/82), via PR [#83](https://github.com/pydata/sparse/pull/83)).
* Support `.size` and `.density` (PR [69](https://github.com/pydata/sparse/pull/69)).
* Documentation added for the package (PR [43](https://github.com/pydata/sparse/pull/43)).
* Minimum required SciPy version is now 0.19 (PR [70](https://github.com/pydata/sparse/pull/70)).
* `len(COO)` now works (PR [68](https://github.com/pydata/sparse/pull/68)).
* `scalar op COO` now works for all operators (PR [67](https://github.com/pydata/sparse/pull/67)).
* Validate axes for `.transpose()` (PR [61](https://github.com/pydata/sparse/pull/61)).
* Extend indexing support (PR [57](https://github.com/pydata/sparse/pull/57)).
* Add `random` function for generating random sparse arrays (PR [41](https://github.com/pydata/sparse/pull/41)).
* `COO(COO)` now copies the original object (PR [55](https://github.com/pydata/sparse/pull/55)).
* NumPy universal functions and reductions now work on `COO` arrays
(PR [49](https://github.com/pydata/sparse/pull/49)).
* Fix concatenate and stack for large arrays (Issue [32](https://github.com/pydata/sparse/issues/32), via PR [#51](https://github.com/pydata/sparse/pull/51)).
* Fix `nnz` for scalars (Issue [47](https://github.com/pydata/sparse/issues/47), via PR [#48](https://github.com/pydata/sparse/pull/48)).
* Support more operators and remove all special cases (PR [46](https://github.com/pydata/sparse/pull/46)).
* Add support for `triu` and `tril` (PR [40](https://github.com/pydata/sparse/pull/40)).
* Add support for Ellipsis (`...`) and `None` when indexing
(PR [37](https://github.com/pydata/sparse/pull/37)).
* Add support for bitwise bindary operations like `&` and `|`
(PR [38](https://github.com/pydata/sparse/pull/38)).
* Support broadcasting in element-wise operations (PR [35](https://github.com/pydata/sparse/pull/35)).

Page 3 of 3

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.