[Tutor] How to calculate high value from multiple lines for each column
fosiul at gmail.com
Sun Feb 28 06:37:05 EST 2016
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][1:]))
print "iostat-%s ,%s" % (key, max(values[key][1:]))
On Sun, Feb 28, 2016 at 12:30 AM, Alan Gauld <alan.gauld at btinternet.com>
> 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])
> print "iostat-%s ,%s" % (key, values[key])
> > b) How can remove first value from for loop - step a ?
> > print "Remove First value", values['dm-30'].pop(0)
> > print "SVTM DM30: ", max(values['dm-30'])
> Instead of using pop() you can use slicing with [1:]:
> print "SVTM DM30: ", max(values['dm-30'][1:])
> print "IOSTAT DM-30",max(values['dm-30'][1:])
> Does it all in one go.
> Alan G
> Author of the Learn to Program web site
> Follow my photo-blog on Flickr at:
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
More information about the Tutor