A sparse vector is a 1D numerical list where most (say, more than 95% of) values will be 0 (or some other default) and for reasons of memory efficiency you don’t wish to store these. (cf. Sparse array)
This implementation has a similar interface to Python’s 1D numpy.ndarray but stores the values and indices in linked lists to preserve memory.
sparse_vector is for numerical data only, if you want any type of data, have a look at sparse_list, the parent library, a dictionary-of-keys implementation of a sparse list in python.
If you need 2D matrices, have a look at scipy.sparse, they also have a linked lists implementation, lil_matrix.
Installation
Available on the cheeseshop.
Installation is simply:
$ pip install sparse_vector
Usage
See the unit-tests!
Contributing
Fork it
Create your feature branch (git checkout -b my-new-feature)
Commit your changes (git commit -am 'Add some feature')
Ensure the tests pass for all Pythons in .travis.yml <https://github.com/johnsyweb/python_sparse_vector/blob/master/.travis.yml>__
Push to the branch (git push origin my-new-feature)
Create new Pull Request
Thanks
johnsyweb for the original sparse_list.
Metadata
Release files for sparse_vector 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sparse_vector-0.4.tar.gz | 4.6 kB | Without provenance | Details for sparse_vector-0.4.tar.gz |
Release files / sparse_vector-0.4.tar.gz
| Download URL | sparse_vector-0.4.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a9f2667f0ab3347c13acc5e51f91426b42a729107863a5923f4e9ac6fba088a2
|
|
BLAKE2b-256 checksum How to use checksums |
6751944657e79f36bd4bf7e259f4649e695e6d867ae14192f939bab5519760e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for sparse_vector 0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.