Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2016-02-11 02:33 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (358 votes), past polls