in reply to PDL rcols : Replacing missing values with 0
Try specifying the column numbers you want to read as rcols 'filename', $column_number, $another_column_number, { OPTIONS => 'values' }:
Is this what you want?pdl> print `cat test.ts`; 1 0 0.1000 0.1000 0.8000 1 0 0.1000 0.1000 0.2750 0.5250 2 0 0.1000 0.1000 0.8000 pdl> ($a, $b, @rest) = rcols 'test.ts', 0..5, { COLSEP => "\t", PERLCO +LS => [0] }; print pdl($a), $b, pdl @rest; Reading data into piddles of type: [ Double Double Double Double Doubl +e ] Read in 3 elements. [1 1 2] [0 0 0] [ [ 0.1 0.1 0.1] [ 0.1 0.1 0.1] [ 0.8 0.275 0.8] [ 0 0.525 0] ] pdl>
Edit: changed the way of printing the gathered values a bit
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: PDL rcols : Replacing missing values with 0
by roark (Initiate) on Aug 18, 2013 at 17:52 UTC |