KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
When iterating over a large array with a range expression, should I use Python's built-in range function, or numpy's arange to get the best performance? My reasoning so far: range probably resorts to a native implementation and might be faster therefore. On the other hand, arange returns a full array, which occupies memory, so there might be an overhead. Python 3's range expression is a generator, which does not hold all the values in memory.
Tags (comma-separated)
Save Edits
Cancel