Hi folks, This is my first real foray in to using PDL for an entire
program. The basis of the program is to use Perl to parse values from a
text file that indicate specifics of 
 
[place1    place2    time    measurement1    measurement2]
 
I am using glue to build up the piddle for each col, row index. To
analyze the data though I need to perform stats and histogram profiles
for each place1,place2 of measurement1, measurement2. I thought that I
could simply slice out the data using nslice and where. However, I don't
get what I expect out when I try it on sample data. I have gone through
the documentation, but have not found any examples to do what I am
trying to do.
 
My example data is :
 
perldl> p $a
 
[
 [ 1  1  2  3  4]
 [ 1  1  7  8  9]
 [ 1  1 12 13 14]
 [ 2  1 17 18 19]
 [ 2  1 22 23 24]
 [ 2  1 27 28 29]
 [ 3  1 32 33 34]
 [ 3  1 37 38 39]
 [ 3  1 42 43 44]
]

To get the data for columns 3 & 4 (the measure columns) I used :
p $a->nslice([3,4],$a->where($a(0)==1))
 
which provided me with :

[
 [ 8  9]
 [ 8  9]
 [13 14]
]
 
What I expected to get was column 3 & 4 for the mask defined by :
perldl> p ($a(0)==1)->(3,4)
 
[
 [1]
 [1]
 [1]
 [0]
 [0]
 [0]
 [0]
 [0]
 [0]
]
Can't call method "nslice" without a package or object reference
 
I don't know why I get the warning/error - but the correct rows were
selected.
 
What am I doing wrong and how do I get:
[
 [ 3  4]
 [ 8  9]
 [13 14]
]
 
Thanks, 
Cliff Sobchuk
Core RF Field Support Engineer
Phone: (403) 769 2063 / ESN 758
 
Confidentiality Notice:This message and any attachments may contain
information that is privileged and confidential. If you have reason to
believe that you are not the intended recipient or a person responsible
for delivering this message to an intended recipient, you are hereby
notified that any review, dissemination, distribution, or copying of
this message is strictly prohibited. If you have reason to believe that
you are not the intended recipient or a person responsible for
delivering this message to an intended recipient, please contact the
sender immediately by reply email and destroy all copies of the original
message.
 

<<emailsig_static_orange.gif>>

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to