skillfed

sparse

Sparse n-dimensional arrays for the PyData ecosystem

sparse v0.19.2 1.5M downloads/30d#3,782 on PyPI666
Permissive license BSD 3-Clause License Copyright (c) 2018, Sparse developers All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the… (full text in the JSON record) Active released

What it is and what it does

Sparse provides multi-dimensional sparse array objects for the PyData ecosystem, built on NumPy and Numba. Unlike dense arrays where every element is stored, sparse arrays only store non-zero values and their coordinates, dramatically reducing memory use for data that is mostly zeros or empty. The library integrates with NumPy's API conventions, making it familiar to scientists and data engineers already working with NumPy arrays.

The package is actively maintained and sits in the top 5000 PyPI packages by download volume. It targets Python 3.10, 3.11, and 3.12, and carries a BSD 3-Clause License. The library is marked as pre-alpha in its development status, indicating the API may evolve, but it is actively developed with recent releases and community support channels.

Use it for:

  • Store and manipulate large tensors with mostly zero values, such as sparse feature matrices in machine learning pipelines.
  • Perform operations on high-dimensional sparse data without materializing dense intermediates.
  • Integrate sparse array computations into NumPy-based scientific workflows with minimal API friction.
  • Accelerate sparse array operations using Numba's JIT compilation for performance-critical code paths.
  • Work with sparse representations of graphs, networks, or other naturally sparse data structures.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides multi-dimensional sparse array data structures compatible with NumPy and Numba, enabling efficient storage and computation on arrays with mostly zero or missing values.

Yes, if you work with sparse high-dimensional data in scientific or machine learning contexts and want NumPy-compatible semantics. The low install friction, active maintenance, and permissive license make it a reasonable choice. Be aware the library is pre-alpha, so expect potential API changes; verify that the sparse formats and operations you need are supported before committing to a production dependency.

Install

sparse on PyPI

pip

pip install sparse

uv

uv add sparse

poetry

poetry add sparse

Installing sparse

Before you install

Low install friction with a pure-Python wheel distribution. Active maintenance with a release on 2026-08-14 and recent commits. Requires NumPy and Numba as runtime dependencies.

License in practice

BSD 3-Clause License permits commercial and private use with minimal restrictions; you must retain copyright notices and disclaimers in source distributions.

Quickstart

import sparse
import numpy as np

# Create a sparse array from a dense array
dense = np.array([[0, 0], [0, 2]])
sparse_arr = sparse.COO.from_numpy(dense)
print(sparse_arr)

Requires Python 3.11 or later.

Verify before relying

  • Which sparse formats (COO, CSR, CSC, etc.) are supported by the library.
  • Performance characteristics compared to other sparse array libraries for typical workloads.
  • Extent of Numba JIT acceleration and which operations benefit most.
  • API stability guarantees given the pre-alpha development status.

Package facts

License BSD 3-Clause License Copyright (c) 2018, Sparse developers All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 2 — numpy, numba
Maintenance actively maintained — 0 days since the last release
Last repo commit
First released
Downloads 1,543,346/month — #3,782 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sparse-0.19.2-py2.py3-none-any.whl

Keywords: sparse, numpy, scipy, dask

Development Status :: 2 - Pre-AlphaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12

Tags

sparse multidimensional arraysn-dimensional sparse data structuresnumpy-compatible sparse arraysmemory-efficient sparse tensorssparse array operationsnumba-accelerated sparse arrayspydata sparse computing
sparse-arraysscientific-computingnumba-accelerated

More Mathematics packages