A Monday 27 October 2008, Anand Patil escrigué: > Hello all, > I have two CArrays, ca1 and ca2. ca1 is meant to hold all the > information in ca2, plus a bit more. I want to do > > ca1[slice] = ca2[:] > > but slice is far too big to read ca2[:] into memory, then write it > into ca1[slice]. Is there an easy way to do this in PyTables or do I > need to copy the data bit by bit using loops?
In principle you need to copy slice by slice, yes. However, you may want to consider using EArrays and use this: ea1 = ea2.copy(dest_group, dest_name) ea1.append(the_rest_of_your_data) > And, as long as I'm on the line: once ca1 is all filled in, I want to > apply numpy.fft.fftn to it in-place. Is there a slick way to do this? Mmh, I've thought several times about implementing functions that work over datasets and the output would be another dataset, but have not a chance to do this yet. So, you will need to do it slice by slice too. In the case the chunks of the dataset are relatively small, you will be able to map them into multidimensional atoms (already implemented for *Array objects in trunk) and do: # ca1 is an existing CArray with a multidimensional atom. ca2 = f.createCArray(dest_group, dest_name, ca1.atom, (ca1.nrows,)) for i, row in enumerate(ca1.iterrows()): ca2[i] = numpy.fft.fftn(row) This will be possible in forthcoming 2.1. -- Francesc Alted ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Pytables-users mailing list Pytables-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pytables-users