Hi Craig- The confusion is between columns in the piddle and columns in the data file. dim(0) of the piddle corresponds to a going down the column in the data file:
> pdl> #cat test3x4 > 0 3 6 9 > 1 4 7 10 > 2 5 8 11 > > pdl> $a = rcols 'test3x4', [] > Reading data into piddles of type: [ Double ] > Read in 12 elements. > > pdl> p $a > > [ > [ 0 1 2] > [ 3 4 5] > [ 6 7 8] > [ 9 10 11] > ] > > pdl> p sequence(3,4) > > [ > [ 0 1 2] > [ 3 4 5] > [ 6 7 8] > [ 9 10 11] > ] > > pdl> @aa = rcols 'test3x4' > Reading data into piddles of type: [ Double Double Double Double ] > Read in 3 elements. > > pdl> p @aa[0..3] > [0 1 2] [3 4 5] [6 7 8] [9 10 11] --Chris On Thu, Jun 7, 2012 at 12:04 PM, Craig DeForest <[email protected]> wrote: > Chris, see my example that reproduces the old behavior with the latest git - > dim(0) running across column within a row and dim(1) running across row > within a column. > > Cheers, > Craig > > On Jun 7, 2012, at 9:49 AM, Chris Marshall wrote: > >> There was a brief period where the 2D array >> support in rcols had different behavior for a >> single column specification versus the new >> 2D array ref specification. >> >> That has been corrected so that dim(0) is >> *always* the data down the column and >> thus, the 2D piddles have dim(1) running >> *across* the columns selected. >> >> As far as I know, the documentation is correct >> as written for PDL-2.4.11. >> >> --Chris >> >> On Thu, Jun 7, 2012 at 10:13 AM, Louis Chaillet >> <[email protected]> wrote: >>> Hi, just a quick question. >>> >>> I noticed that the order of the dimensions of a piddle that I read from file >>> with rcols seem to have changed from Perl release 5.10.1 to 5.14.2. >>> >>> It may have changed in between, but those are the versions I have. In the >>> earlier version the first dimension was over the rows of the file. In the >>> second it is over the columns of the file. >>> >>> Is this correct, or am I missing something? If it is correct what was the >>> first version with the first dimension over the columns of the file? >>> >>> Kind regards, Louis >>> >>> _______________________________________________ >>> Perldl mailing list >>> [email protected] >>> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl >>> >> >> _______________________________________________ >> Perldl mailing list >> [email protected] >> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl >> > _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
