Scenario 1:
You make a list and fill it with data. Task done.
Scenario 2:
You've to repeat this one million times.
If scenario 2 is the case, then preallocate the
Then you can work with the same list one million times without creating new lists/arrays.
Of course, this depends on the algorithm you're using.
Allocating memory is slow.
You make a list and fill it with data. Task done.
Scenario 2:
You've to repeat this one million times.
If scenario 2 is the case, then preallocate the
numpy.array
once.Then you can work with the same list one million times without creating new lists/arrays.
Of course, this depends on the algorithm you're using.
Allocating memory is slow.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!