Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 taking refuge in the Monastery: (10)
As of 2015-07-07 23:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls