--- id: sparse version: "0.19.2" 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) license_treatment: permissive maintenance: active --- # sparse — Sparse n-dimensional arrays for the PyData ecosystem License: permissive · Maintenance: active · Downloads: 1.5M/mo ## 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 above — 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 pip install sparse uv add sparse 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_current - Install friction: low - Maintenance: active - Downloads: 1.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags sparse multidimensional arrays, n-dimensional sparse data structures, numpy-compatible sparse arrays, memory-efficient sparse tensors, sparse array operations, numba-accelerated sparse arrays, pydata sparse computing, sparse-arrays, scientific-computing, numba-accelerated [View on SkillFed](https://skillfed.io/packages/sparse) · [View on PyPI](https://pypi.org/project/sparse/)