Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Query of multi dimentional array

by bliako (Monsignor)
on Mar 26, 2020 at 10:43 UTC ( [id://11114666]=note: print w/replies, xml ) Need Help??


in reply to Re: Query of multi dimentional array
in thread Query of multi dimentional array

And just in case you wanted to search by GeneID (which is very likely in a next step):

my %myArray; #my @myArray; my $GeneID = shift @columns; $myArray{$GeneID} = \@columns; #push @myA +rray, \@columns; # and how to calculate sum of each row for my $GeneID (sort keys %myArray){ # optionally sort to have a consi +stent view my $sum = 0; for my $colItem (@{$myArray{$GeneID}}){ $sum += $colItem; } print "sum for $GeneID: $sum\n"; }

bw, bliako

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found