Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: quick way to add value of a hash with same x, y, z?

by QM (Parson)
on Aug 10, 2017 at 10:08 UTC ( #1197145=note: print w/replies, xml ) Need Help??

in reply to quick way to add value of a hash with same x, y, z?

Quick comments: Use a hash on the first file, such as:
$hash{"$x,$y,$z"}{no} = $no; $hash{"$x,$y,$z"}{pressure} = $pressure;

Then with the coords from the second file, search in the hash for matching coords.

Problem: The coords have a lot of decimal places. These should be normalized before creating the hash entries, and before searching the hash keys. Decide how many significant digits are more than enough, and use sprintf with a fixed decimal ("f") descriptor.

Quantum Mechanics: The dreams stuff is made of

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1197145]
[shmem]: hmm after some looping I get it via http
[choroba]: After submitting the form, I'm getting "Sorry, we're really busy right now, please wait for a bit. This page will automagically refresh soon"
[hippo]: Still nothing via https
marto pictures someone trying to fix a problem, while the page gets battered by F5s :P
[hippo]: Who maintains deps? Is it barbie?

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2018-02-20 12:05 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (271 votes). Check out past polls.