[Numpy-discussion] numpy.append & numpy.where vs list.append and brute iterative for loop

Sturla Molden sturla at molden.no
Thu Jan 27 16:47:22 EST 2011


Den 27.01.2011 22:03, skrev Dewald Pieterse:
> Is numpy.append so slow? or is the culprit numpy.where?

Please observe that appending to a Python list is amortized O(1), 
whereas appending to a numpy array is O(N**2).

Sturla



More information about the NumPy-Discussion mailing list