3 ms·
For large collections of homogenous values, using the array or struct modules is best for memory (and often for speed as well). Or if math is needed, then nump
by apu 17y ago
For large collections of homogenous values, using the array or struct modules is best for memory (and often for speed as well).
Or if math is needed, then numpy arrays are best.
Storing homogenous data in lists/tuples is fine if performance/memusage is not critical, or for small collections (i.e., 90% of use-cases).