Let's say we have a long one dimensional array like this with millions of elements:

`[0,1,1,1,1,2,1,1,1,1,1,1,1,...,1,2,2,2,2,2,2,2,4,4,4,4,4,4,4,4,4,3,4,1,1,1,1]`

If there was just one repeating element we could use a sparse array but since it can be any kind of integer value (or a set of nominal elements), this does not do the trick I suppose (or am I wrong there?).

I read about PyTables being able to compress data like this on the fly, based on HDF5 files, as far as I could see, this seems like the go to option for python. 

Has someone experience with it and can tell whether that is an adequate route to go or are there other ways, that are even more efficient in terms of cpu as well as memory usage (trading the least amount of CPU cycles into decreased memory size).