Skip to main content

A list where most (>95%) values will be None (or default)

Project description

Inspired by the post Populating a sparse list with random 1’s on StackOverflow.

A “sparse list” is a list where most (say, more than 95% of) values will be None (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 built-in list but stores the data in a dictionary to conserve memory.

Installation

sparse_list is available from The Python Package Index (PyPI) .

Installation is simply:

$ pip install sparse_list

Usage

See the unit-tests!

Contributing

  1. Fork it

  2. Create your feature branch (git checkout -b my-new-feature)

  3. Commit your changes (git commit -am 'Add some feature')

  4. Ensure the tests pass for all Pythons in .travis.yml

  5. Push to the branch (git push origin my-new-feature)

  6. Create new Pull Request

Thanks

If you find this stuff useful, please follow this repository on GitHub. If you have something to say, you can contact johnsyweb on Twitter and GitHub.

Many thanks

I’m grateful for contributions to what was a solo project (hooray for GitHub :octocat:)! If you’d like to thank the contributors, you can find their details here:

https://github.com/johnsyweb/python_sparse_list/graphs/contributors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sparse_list-0.7.tar.gz (3.9 kB view details)

Uploaded Source

Built Distributions

sparse_list-0.7-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

sparse_list-0.7-py2-none-any.whl (4.1 kB view details)

Uploaded Python 2

File details

Details for the file sparse_list-0.7.tar.gz.

File metadata

  • Download URL: sparse_list-0.7.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sparse_list-0.7.tar.gz
Algorithm Hash digest
SHA256 abfada3f84f911e61cd346b7b9606ee712c45fbfe571cceaced96c9ee4aff0ef
MD5 26ca9e4ed9e87fce2bcceb636498311f
BLAKE2b-256 5969a8e20bd976833bd5aecdcb1d1a4fc82e0958336827d275c733ca4dc518a1

See more details on using hashes here.

File details

Details for the file sparse_list-0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for sparse_list-0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 984a59dd18096d4898bff7173ae826cc509c94c81c9e7d81b7c20d4cf5806e1a
MD5 663049e8885b84fb6120a46911cdca26
BLAKE2b-256 fb9314f185f1c856984f2adac6d258705782482d397c2a931e68125df90f81e7

See more details on using hashes here.

File details

Details for the file sparse_list-0.7-py2-none-any.whl.

File metadata

File hashes

Hashes for sparse_list-0.7-py2-none-any.whl
Algorithm Hash digest
SHA256 39c3673ac9b4b0b6eed2a57eeba53d7f966d506157a112d4490b76446ac8cbad
MD5 f6be14a285ec1b876cb8470ff97fb03d
BLAKE2b-256 172be534a3c3d53aaf629783cc3a97a72a5da1f11a50994feadc403417882006

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page