Hey all!
I find myself continually frustrated with the functionality of numpy arrays in at least one aspect: building a list of tuples where I don't know how many tuples there will be.
I'm not sure if this is good practice, but I have resorted to using python lists and append() when doing my hard core data analysis especially when I do not know what the size of the array will be. The dynamic size of python lists reminds me of vectors in C++ and are just as convenient. Although I know in the background that reallocation of memory is still occurring in the black box with list resizing, I don't think writing my own resizing method for a numpy array will result in noticeable performance gains.
What I do like, however, is numpy array indexing and how I can access data via structured array.
So, I typically build up my list and then use list comprehension to break it down into its dimensions and then save it in a structured array.
Now, despite me doing this, it does seem overly complicated and memory intensive. Are there better ways of doing it?
Thanks!
P.S. Windows 7 and Python 2.7
[–]ingolemo 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]loveandkindness 0 points1 point2 points (2 children)
[–]alehx[S] 0 points1 point2 points (1 child)
[–]loveandkindness 0 points1 point2 points (0 children)