[Tutor] How to calculate high value from multiple lines for each column
Alan Gauld
alan.gauld at btinternet.com
Fri Feb 26 03:12:56 EST 2016
On 26/02/16 02:36, Fosiul Alam wrote:
> 1) the final data out put only has one values dm-31 but dm-30 is
> missing.
That's because data is only ever the last iteration of the loop.
Your output is in values not data.
Try printing values at the end of the loop.
> 2) I need to assoicated values with dm name example dm-30 and dm-31 as
> final result .
You are already doing that.
Its working as expected.
> ['dm-30', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00',
> '0.00', '0.00', '0.40', '0.50']
> [[18.27, 2.0], [6.3600000000000003, 1.0]]
> ===
> ['dm-31', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00',
> '0.00', '0.00', '0.70', '0.60']
> [[18.280000000000001, 3.0], [6.3700000000000001, 1.5]]
Note that the data lines above reflect the correct results for both dm30
and dm31.
So values is storing both sets of data correctly.
After the loop try:
print "DM30: ", values['dm-30']
print "DM31:", values['dm-31']
HTH,
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
More information about the Tutor
mailing list