From: Andre' Walker-L. <wal...@gm...> - 2012-10-06 22:26:47
|
Hi Anthony, > You can use tuple addition to accomplish what you want: > > (0,) + data.shape == (0,256,1,2) > > Be Well > Anthony Thanks! I knew there had to be a better way. Cheers, Andre > > On Sat, Oct 6, 2012 at 12:42 PM, Andre' Walker-Loud <wal...@gm...> wrote: > Hi All, > > I have a bunch of hdf5 files I am using to create one hdf5 file. > Each individual file has many different pieces of data, and they are all the same shape in each file. > > I am using createEArray to make the large array in the final file. > > if the data files in the individual h5 files are of shape (256,1,2), then I have to use > > createEArray('/path/','name',tables.floatAtom64(),(0,256,1,2),expectedrows=len(data_files)) > > if the np array I have grabbed from an individual file to append to my EArray is defined as data, is there a way to use data.shape to create the shape of my EArray? > > In spirit, I want to do something like (0,data.shape) but this does not work. > I have been scouring the numpy manual to see how to convert > > data.shape > (256,1,2) > > to (0,256,1,2) > > but failed to figure this out (if I don't know ahead of time the shape of data - in which case I can manually reshape). > > > Thanks, > > Andre > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > Pytables-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pytables-users > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev_______________________________________________ > Pytables-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pytables-users |