I had thought about doing the later, where you run over and over the data gathering rows in the new order, but I speculate that this would have some questionable scaling implications performance wise. But maybe it's just so blazing fast reading in those blocks that it would be ok.
Stefan ----- Original Message ---- From: Francesc Altet <[EMAIL PROTECTED]> To: Stefan Kuzminski <[EMAIL PROTECTED]> Cc: [email protected] Sent: Wednesday, January 10, 2007 1:38:36 PM Subject: Re: [Pytables-users] reordering an array efficiently El dc 10 de 01 del 2007 a les 08:53 -0800, en/na Stefan Kuzminski va escriure: > I have been using the readCoordinates() method on the Table class for some > time. I'm switching from Tables to EArrays, but the EArray class does not > have a readCoordinates? If I loop over the index array that is the new order > and call read for each item performance suffers. Is there a fast way to > reorder an EArray ( or VLArray )? There is currently no provision for such an sparse read (this is what readCoordinates() does) for *Array objects. It shouldn't be too difficult to add such a method, but most of the advanced functionality is implemented for the Table objects only (hence the PyTables name :). In order to do such a reodering, one straighforward way should be to load the entire array in memory, reorder it there, and save it again. However, the most probable thing is that you cannot do that because your arrays wouldn't fit in memory. Sorry, but I can't realize an efficient way to do what you want other than reading the EArray by entire chunks (instead of reading row by row), select the interesting rows in a buffer, and save them in the destination EArray. Of course, this represents a fair amount of work on your side for implementing such a buffered I/O algorithm. Cheers, -- Francesc Altet | Be careful about using the following code -- Carabos Coop. V. | I've only proven that it works, www.carabos.com | I haven't tested it. -- Donald Knuth ____________________________________________________________________________________ Have a burning question? Go to www.Answers.yahoo.com and get answers from real people who know. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Pytables-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pytables-users
