# [Tutor] How to calculate high value from multiple lines for each column

Fosiul Alam fosiul at gmail.com
Sun Feb 28 06:37:05 EST 2016

```Thanks Alan
bellow works perfect ..
and thanks you very much for all your support
I just need to do one thing which I should be able to do  my self,
hopefully will be able to finish the whole thing soon.
if i can i just ask you one more favour in related to this qustion.

for key in values:
print "svtm-%s ,%s" % (key, max(values[key][0][1:]))
print "iostat-%s ,%s" % (key, max(values[key][1][1:]))

On Sun, Feb 28, 2016 at 12:30 AM, Alan Gauld <alan.gauld at btinternet.com>
wrote:

> On 27/02/16 15:46, Fosiul Alam wrote:
>
> > a) Can I combile 2 forloop into one ?
>
> Yes of course.
>
>       for key in values:
>           print "svtm-%s ,%s" % (key, values[key][0])
>           print "iostat-%s ,%s" % (key, values[key][1])
>
>
> > b) How can remove first value from for loop - step a ?
>
> >         print "Remove First value", values['dm-30'][0].pop(0)
> >         print "SVTM DM30: ", max(values['dm-30'][0])
>
> Instead of using pop() you can use slicing with [1:]:
>
>     print "SVTM DM30: ", max(values['dm-30'][0][1:])
>     print "IOSTAT DM-30",max(values['dm-30'][1][1:])
>
>
> Does it all in one go.
>
>
> --
> 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
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>

--
Regards
Fosiul Alam
```