<commit_before># Sparse List [![Build Status](https://travis-ci.org/johnsyweb/python_sparse_list.png)](https://travis-ci.org/johnsyweb/python_sparse_list) 

Inspired by http://stackoverflow.com/q/17522753/78845

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](http://en.wikipedia.org/wiki/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 [PyPI - the Python Package
Index](https://pypi.python.org/pypi) (aka [The
Cheeseshop](https://pypi.python.org/pypi)). Installation is simply:

    $ pip install sparse_list

## Usage

See the [unit-tests](https://github.com/johnsyweb/python_sparse_list/blob/master/t_sparse_list.py)!

## Contributing

1. Fork it
1. Create your feature branch (`git checkout -b my-new-feature`)
1. Commit your changes (`git commit -am 'Add some feature'`)
1. Ensure the tests pass for all Pythons in [`.travis.yml`](https://github.com/johnsyweb/python_sparse_list/blob/master/.travis.yml)
1. Push to the branch (`git push origin my-new-feature`)
1. Create new Pull Request

## Thanks

If you find this stuff useful, please follow this repository on
[GitHub](https://github.com/johnsyweb/python_sparse_list). If you have something to say,
you can contact [johnsyweb](http://johnsy.com/about/) on
[Twitter](http://twitter.com/johnsyweb/) and
[GitHub](https://github.com/johnsyweb/).<commit_msg>Add links and badges to README.<commit_after># [Sparse List](https://pypi.python.org/pypi/sparse_list) [![PyPi version](https://pypip.in/v/sparse_list/badge.png)](https://crate.io/packages/sparse_list/) [![PyPi downloads](https://pypip.in/d/sparse_list/badge.png)](https://crate.io/packages/sparse_list/) [![Build Status](https://travis-ci.org/johnsyweb/python_sparse_list.png)](https://travis-ci.org/johnsyweb/python_sparse_list) 

Inspired by the post [Populating a sparse list with random
1's](http://stackoverflow.com/q/17522753/78845) on
[StackOverflow](http://stackoverflow.com/).

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](http://en.wikipedia.org/wiki/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`](https://pypi.python.org/pypi/sparse_list) is available from
[PyPI - the Python Package Index](https://pypi.python.org/pypi) (aka [The
Cheeseshop](https://pypi.python.org/pypi)).

Installation is simply:

    $ pip install sparse_list

## Usage

See the
[unit-tests](https://github.com/johnsyweb/python_sparse_list/blob/master/t_sparse_list.py)!

## Contributing

1. Fork it
1. Create your feature branch (`git checkout -b my-new-feature`)
1. Commit your changes (`git commit -am 'Add some feature'`)
1. Ensure the tests pass for all Pythons in
   [`.travis.yml`](https://github.com/johnsyweb/python_sparse_list/blob/master/.travis.yml)
1. Push to the branch (`git push origin my-new-feature`)
1. Create new Pull Request

## Thanks

If you find this stuff useful, please follow this repository on
[GitHub](https://github.com/johnsyweb/python_sparse_list). If you have something
to say, you can contact [johnsyweb](http://johnsy.com/about/) on
[Twitter](http://twitter.com/johnsyweb/) and
[GitHub](https://github.com/johnsyweb/).
{'fraction_non_alphanumeric': 0.13598673300165837, 'fraction_numerical': 0.011885019347705915, 'mean_word_length': 4.72626582278481, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 22, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4163729', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1195, 'n_words': 340}