Depends. Does your data still fit into memory? Do you need the distributions more than once or do you just stuff them into some statistics package or chart generator? Do you need the individual numbers in a bin or only the count? Do you know the different distributions you want beforehand or do you want interactivly change the lengths? Do you need more than one distribution simultaneously or is only the last distribution relevant?
The following code deals with the simplest case:
sub finddistribution { my ($length, $numref)= @_; my @counts; foreach my $num (@$numref) { $counts[$num/$length]++; } return @counts; } ... my @dezimaldistri= finddistribution(10,\@nums);
In reply to Re: build a distribution
by jethro
in thread build a distribution
by Grig
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |