I am trying to optimize my code by removing for loops and list comprehension by using numpy arrays. In general the execution of the code is now faster, BUT there is a thing that bothers me a lot: converting my list with about 110000 elements to a numpy array takes most of the time of the program runtime (5 to 7 seconds, just to initialize an array!)
I have this
rec = np.array(records)
where records
is a list of objects.
Is it possible to speed up the creation of this numpy array?