BitVector

John Machin sjmachin at lexicon.net
Mon Mar 10 02:57:35 EDT 2008


On Mar 10, 3:26 pm, DanielJohnson <diffuse... at gmail.com> wrote:
> Hi,
>
> I am trying to solve a genetic algorithm problem where I want to read
> a bitvector of very large size (say 10000) and manipulate bits based
> on certain algorithms.
>
> I am a newbie in Python. What data structure are good to read such
> huge data set. Are there any built in classes for bit fiddling.
>

Bitwise operations like & | ^ << >> etc work on long integers. This
happens at C speed. An alternative (in pure Python) is found via:
http://pypi.python.org/pypi/BitVector

HTH,
John



More information about the Python-list mailing list