Hi, thanks all for the feedback. Sorry I did not respond earlier (European soccer championship is keeping me away). As I now understand it is important to know what the version of PDL is for rcols in 2d piddles. I looked it up on my machine. In perl 5.10.1 (on a debian squeeze) the PDL version was v2.4.7._001 and the first row of a data file read with rcols ends up in the first dimension of the PDL. In perl 5.14.2, PDL 2.4.10 is installed (same machine now using perlbrew) and the first row of a datafile read with rcols ends up in the second dimension of the PDL. I looked up the release notes for PDL v2.4.10 and the dimensionality of rcols is mentioned under incompatible changes (see http://sourceforge.net/projects/pdl/files/PDL/2.4.10/README.txt/view). From the release notes of 2.4.9 it seems that issue had already changed there. I did not test 2.4.9, but it seems that that is the first release with the current behavior.
So I will include the use directive for the PDL version 2.4.9 (use PDL v2.4.9) and make sure I have predictable behavior independent of the installed version. Kind regards, Louis 2012/6/7 Chris Marshall <[email protected]> > Well, now I'm confused myself. I don't have time to > think clearly on this but if there is a better use case > for using the old orientation, a Feature Request could > be made. In the meantime, at least the docs are > correct and a transpose of axes can fix a "wrong" > dimension order problem. > > --Chris > > On Thu, Jun 7, 2012 at 12:32 PM, Craig DeForest > <[email protected]> wrote: > > Chris: you are right. I am being stupid. > > > > Yes, selecting ((0)) yields the first row of the file, which is exactly > what Louis was complaining about. So the documentation is correct. > > > > > > > > > > On Jun 7, 2012, at 10:27 AM, Chris Marshall wrote: > > > >> 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
