Since where() automatically flattens things, you can skip the ->flat unless you explicitly need a 1-D output.
--Chris On Fri, Jan 13, 2012 at 12:48 PM, David Mertens <[email protected]> wrote: > Zev - > > You cannot do this in one line (to my knowledge). I would use PDL::NiceSlice > and construct this like so: > > use PDL::NiceSlice; > my $a = sequence(10,10) > my $slice_of_a = $a(1:3)->flat; > my $result = $slice_of_a->where($slice_of_a > 10); > > Note that where is very powerful. For example, if $a and $b have the same > size, you can do this: > > my $result = $a->where($b < 10); > > or you can return a slice of both $a and $b: > > my ($a_result, $b_result) = where($a, $b, $b < 10); > > David > > On Fri, Jan 13, 2012 at 11:34 AM, zev <[email protected]> wrote: >> >> Greetings, >> >> Another basic question: >> >> If I want to run the command below what can I replace the '*' with to get >> the command to work? I am trying to figure out what variable is piped from >> flat to where. >> >> $a = sequence(10,10) >> >> $a->slice("1:3,:")->flat->where(* > 10) >> >> -- >> Zev Kronenberg >> Graduate Student >> University of Utah >> phone: 208-629-6224 >> >> >> _______________________________________________ >> Perldl mailing list >> [email protected] >> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl >> > > > > -- > Sent via my carrier pigeon. > > _______________________________________________ > 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
