Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: min and mindex

by Khen1950fx (Canon)
on Nov 06, 2012 at 19:13 UTC ( #1002565=note: print w/ replies, xml ) Need Help??


in reply to min and mindex

Maybe this can be of some help:

#!usr/bin/perl -l BEGIN { $| = 1; $^W = 1; } use strict; use warnings; use Statistics::Descriptive; use List::Util qw(minstr maxstr); my(@array1) = qw(1 2 3 4 5 6 7); my $min_index = Statistics::Descriptive::Sparse->new(); $min_index->add_data(@array1); my $min = $min_index->min; my $max = $min_index->max; my $mindex = $min_index->mindex; print "Min: ", $min, minstr 'a'..'g'; print "Max: ", $max, maxstr 'a'..'g'; print "Mindex: ", $mindex; print "Mindex: ", $min_index->mindex('a'..'g');


Comment on Re: min and mindex
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2014-08-27 20:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (252 votes), past polls