in reply to how to get clusters?
#!/usr/bin/perl use strict; use warnings; my (@cluster1, @cluster2); open FILE, 'dataset.txt'; while (<FILE>){ my @cols = split /\s+/; if ($cols[0] =~ m/\d/){ if ($cols[2] < 200){ push @cluster1, [@cols]; } else { push @cluster2, [@cols]; } } } # simple test to make sure it worked. foreach my $row (@cluster1) { #print "$cluster1[$row]\n"; print "@$row\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to get clusters?
by Anonymous Monk on Jan 04, 2008 at 17:57 UTC | |
by Not_a_Number (Prior) on Jan 04, 2008 at 19:42 UTC | |
by amarquis (Curate) on Jan 04, 2008 at 19:04 UTC | |
by eric256 (Parson) on Jan 04, 2008 at 20:36 UTC |