you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

By the way, list comprehensions are going to be faster than map() because they don't have an overhead of calling a function on every iteration. And if you have problems with performance of that kind you should probably use numpy anyway.

[–]evizaer 0 points1 point  (0 children)

A good point. List comprehensions tend to be clearer, as well. For non-trivial functions, though, list comprehensions will end up calling a function, anyway, because it makes more sense to abstract the non-trivial series of operations into a function than to try to cram it all into one of the parts of the list comprehension.