sajuptpm wrote:
> i want to find the loaded machine based on cpu and mem and desk
> utilization by changing this order.
>
> I created a UI using that i can change the order of item in the tuple.
> But the problem is asc and desc sorting
How about only changing the order in which the elements are
On Sep 7, 1:16 pm, Ulrich Eckhardt wrote:
> sajuptpm wrote:
> > I have a list of tuples l = [((cpu_util,mem_util),(disk_util)),
> > ((cpu_util,mem_util),(disk_util))]
> > ie, l = [((30,50),(70)), ((50,20),(20))]
>
> > l.sort(key=lambda x:(-x[0][0], x[1][0]))
> > # sorting cpu_util asc and disk_uti
sajuptpm wrote:
> I have a list of tuples l = [((cpu_util,mem_util),(disk_util)),
> ((cpu_util,mem_util),(disk_util))]
> ie, l = [((30,50),(70)), ((50,20),(20))]
>
> l.sort(key=lambda x:(-x[0][0], x[1][0]))
> # sorting cpu_util asc and disk_util desc
One thing here: Without knowing what special m
On 7 Sep, 07:42, sajuptpm wrote:
> More details
> I have a list of tuples l = [((cpu_util,mem_util),(disk_util)),
> ((cpu_util,mem_util),(disk_util))]
> ie, l = [((30,50),(70)), ((50,20),(20))]
>
> l.sort(key=lambda x:(-x[0][0], x[1][0])) # sorting cpu_util asc and
> disk_util desc
>
> suppose i c
sajuptpm wrote:
> More details
> I have a list of tuples l = [((cpu_util,mem_util),(disk_util)),
> ((cpu_util,mem_util),(disk_util))]
> ie, l = [((30,50),(70)), ((50,20),(20))]
>
> l.sort(key=lambda x:(-x[0][0], x[1][0])) # sorting cpu_util asc and
> disk_util desc
>
> suppose i changed order th
More details
I have a list of tuples l = [((cpu_util,mem_util),(disk_util)),
((cpu_util,mem_util),(disk_util))]
ie, l = [((30,50),(70)), ((50,20),(20))]
l.sort(key=lambda x:(-x[0][0], x[1][0])) # sorting cpu_util asc and
disk_util desc
suppose i changed order that is l = [((mem_util,cpu_util),
(d
sajuptpm wrote:
I have a list of tuples l = [(('s','a'),(5,9)), (('u','w'),(9,2)),
(('y','x'),(3,0))] and postion of values in the tuple change
dynamicaly. I need a way to access correct value even if change in
position.
from itertools import starmap, izip, imap
list(imap(dict, starmap(izip, d)
sajuptpm wrote:
> I need to change position of each values in the list and that dont
> affect fuctions which are using this list.
So you want to change the list's content but you don't want anyone to be
able to detect the difference? That doesn't make sense.
> I must have to use list of tuples.
>
I have a list of tuples l = [(('s','a'),(5,9)), (('u','w'),(9,2)),
(('y','x'),(3,0))] and postion of values in the tuple change
dynamicaly. I need a way to access correct value even if change in
position.
--
http://mail.python.org/mailman/listinfo/python-list
I have a list of tuples l = [(('s','a'),(5,9)), (('u','w'),(9,2)),
(('y','x'),(3,0))]
some functions using this list and fetch data using index l[0][1], l[1]
[1]
I need to change position of each values in the list and that dont
affect fuctions which are using this list.
I must have to use list of
10 matches
Mail list logo