Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: RFC: 100 PDL Exercises (ported from numpy)

by vr (Curate)
on May 03, 2018 at 17:12 UTC ( [id://1214017]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    print $x-> transpose
            -> whereND( $mask )
            -> transpose;
    
  2. or download this
    print $z-> info( '%M' );
    
  3. or download this
    my $a = ones(3);
    my $b = 2 * ones(3);
    ...
    $b *= $a;
    
    print $b;
    
  4. or download this
    my $z = random( 10 );
    $z( $z-> maximum_ind ) .= 0;
    print $z;
    
  5. or download this
    my $z = zeroes( 10 );
    my $i = pdl( 1, 3, 5, 3, 1 );
    indadd( 1, $i, $z );
    print $z;
    
  6. or download this
    my $z = 1 + sequence 14;
    my $len = 4;
    
    print $z-> lags( 0, 1, 1 + $z-> nelem - $len )
            -> slice( '','-1:0' );
    
  7. or download this
    my $x = sequence 16, 16;
    
    ...
            -> lags( 0, 4, 4 )
            -> slice( '', '-1:0' )
            -> sumover;
    
  8. or download this
    my $x = sequence 16, 16;
    
    ...
            -> reorder( 0, 2, 1, 3 )
            -> clump( 2 )
            -> sumover
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1214017]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-25 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found