4 ms·
- First example is a bit unfair to vanilla python. A better implementation would be the following, which is two times faster (than the given vanilla example):
by mertd 14y ago
- First example is a bit unfair to vanilla python. A better implementation would be the following, which is two times faster (than the given vanilla example):
from itertools import izip
X = xrange(10000000)
Y = xrange(10000000)
Z = [x + y for x,y in izip(X,Y)]
- You didn't mention the difference between flatten() and ravel(). flatten() always makes an explicit copy, ravel() doesn't.
- "Arrays must have the same shape to be concatenated with concatenate()."
Except for the concatenation axis obviously.
- fijal 14y agovanilla CPython to be precise. PyPy is drastically faster on stuff like that.