What is an efficient way to initialize and access elements of a large array in Python?
I want to create an array in Python with 100 million entries, unsigned 4-byte
Try this:
x = [0] * 100000000
It takes just a few seconds to execute on my machine, and access is close to instant.