I am trying to create a large Boolean array (for a prime number sieve). I used first Python lists, but at limit = 10^9
this created a MemoryError
.
boolarray = [True] * limit
Then I learned about Numpy and read that it is better with space organisation, so I tried
boolarray = np.full(limit, True, dtype = bool)
The limit only marginally increased to 10^10
, which is not sufficient, since I need 10^12
. I find this surprising, you just need a bit for Boolean, don't you? Any idea, how to overcome this problem? Thanks in advance.