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.
bool_ Boolean (True or False) stored as a byte. Now i let others / you do some research on this design-decision. It's highly linked to CPU-architecture and intended use-cases.10**12 / (8 * 1024**3)). Unless you have a crazy amount of ram you should probably look for a different approach.