For a lot of functions, it is possible to use either native Python or numpy to proceed.
This is the case for math functions, that are available with Python native import math, but also with numpy methods. This is also the case when it comes to arrays, with narray from numpy and pythons list comprehensions, or tuples.
I have two questions relative to these features that are in Python and also in numpy
in general, if method is available in native Python AND numpy, which of both solutions would you prefer ? In terms of efficiency ? Is it different and how Python and numpy would differ in their proceeding?
More particularly, regarding arrays, and basic functions that are dealing with arrays, like sort, concatenate..., which solution is more efficient ? What makes the efficiency of the most efficient solution?
This is very open and general question. I guess that will not impact my code greatly, but I am just wondering.
array.array. (No fancy math operators there, though, just efficient storage.)