[Numpy-discussion] recarray slow?

wheres pythonmonks wherespythonmonks at gmail.com
Wed Jul 21 15:12:14 EDT 2010


I have an recarray -- the first column is date.

I have the following function to compute the number of unique dates in
my data set:


def byName(): return(len(list(set(d['Date'])) ))

Question:  is the string 'Date' looked up at each iteration?  If so,
this is dumb, but explains my horrible performance.
Or, is there a better way to code the above?

Can I convert this to something indexed by column number and convert
'Date' to column number "0" upfront?  Would this help with speed?

W



More information about the NumPy-Discussion mailing list