I am using recarray to store experiment information that is read from a file: self.records = numpy.rec.fromrecords(self.allData,formats='f4,S30,S30,f4,f4,f4,f4,f4,f4,f4,f4,f4,f4',names='MotorNum,MotorType,MotorName,MotorHP, NSync,NShaftFL,NShaft,pLoad,pLoadSlipMethod, pLoadORMEL,etaMeasured,etaORMEL,etaNameplate') Now I would like to add additional "columns" to this array for my calculations/analysis of the data. How is this done? Thanks, Kevin ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
Kevin Christman wrote:
I am using recarray to store experiment information that is read from a file:
self.records = numpy.rec.fromrecords(self.allData,formats='f4,S30,S30,f4,f4,f4,f4,f4,f4,f4,f4,f4,f4',names='MotorNum,MotorType,MotorName,MotorHP, NSync,NShaftFL,NShaft,pLoad,pLoadSlipMethod, pLoadORMEL,etaMeasured,etaORMEL,etaNameplate')
Now I would like to add additional "columns" to this array for my calculations/analysis of the data. How is this done? Thanks,
You need to make a new dtype with the new columns. Then make an empty array with the new dtype. Copy in each column from the old array. Add the new column's data. For example: http://projects.scipy.org/pipermail/numpy-discussion/2007-September/029357.h... -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
participants (2)
-
Kevin Christman
-
Robert Kern