in reply to placing values into bins
my @data = ( [ 123.7, 456.7 ], [ 564.7, 234.9 ], ); for my $datum ( @data ) { my( $x, $y ) = @$_; $bins[ int $x ][ int $y ]++; } for my $x ( 0 .. $#bins ) { defined $bins[$x] or next; for my $y ( 0 .. $#{$bins[$x]} ) { defined $bins[$x][$y] or next; print "$x $y $bins[$x][$y]\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: placing values into bins
by Anonymous Monk on Apr 28, 2005 at 12:59 UTC | |
by tlm (Prior) on Apr 28, 2005 at 13:18 UTC | |
by mrborisguy (Hermit) on Apr 28, 2005 at 14:05 UTC |