Hi,
I am trying to convert a list of pairs (l4) to list l5 by removing those
pairs from l4 which are not present in a third list called pairList.
The following is a simplified part of the routine i have written. However
it does not give the correct output. Please help!
Its possible i have made
Le Lundi 12 Juin 2006 10:12, Girish Sahani a écrit :
def getl5():
l5 = []
pairList = [[1,2],[3,4],[3,5],[3,6],[9,7],[8,9],[8,7],[7,9],[11,10]]
l4 =
[[4,2],[4,7],[4,10],[4,12],[9,2],[9,7],[9,10],[9,12],[11,2],[11,7]] for
pair in l4:
if pair not in pairList:
Hi,
I am trying to modify a list of pairs (l4) by removing those
pairs which are not present in a third list called pairList.
The following is a simplified part of the routine i have written. However
it does not give the correct output. Please help!
Its possible i have made a trivial mistke
Le Lundi 12 Juin 2006 10:25, Girish Sahani a écrit :
Hi,
I am trying to modify a list of pairs (l4) by removing those
pairs which are not present in a third list called pairList.
The following is a simplified part of the routine i have written. However
it does not give the correct output.
Girish Sahani wrote:
Hi,
I am trying to modify a list of pairs (l4) by removing those
pairs which are not present in a third list called pairList.
The following is a simplified part of the routine i have written. However
it does not give the correct output. Please help!
Its possible i
Thanks!It workedi wasted a lot of time trying to find a bug in my
code...what is wrong in iterating over a list and modifying it?
Doesnt python take the modified list every time the loop starts?
Also in this case, i want to add a condition that if none of the pairs are
in pairList, element =
Girish Sahani wrote:
Hi,
I am trying to convert a list of pairs (l4) to list l5 by removing those
pairs from l4 which are not present in a third list called pairList.
The following is a simplified part of the routine i have written. However
it does not give the correct output. Please
Thank you Markthis works too...
Btw going slightly off-topic, when i try to run a code like below with
around 50 elements (pairs) in l4,python just hangs. Any ideas why this is
happening...the data is not that large :((
Girish Sahani wrote:
Hi,
I am trying to modify a list of pairs (l4)
Girish Sahani wrote:
Hi,
I am trying to modify a list of pairs (l4) by removing those
pairs which are not present in a third list called pairList.
The following is a simplified part of the routine i have written. However
it does not give the correct output. Please help!
Its possible i
Girish Sahani [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
I am trying to modify a list of pairs (l4) by removing those
pairs which are not present in a third list called pairList.
The following is a simplified part of the routine i have written. However
it does not give
Girish Sahani wrote:
Btw going slightly off-topic, when i try to run a code like below with
around 50 elements (pairs) in l4,python just hangs. Any ideas why this is
happening...the data is not that large :((
building a filtered new list by repeatedly removing stuff from a copy
of the
Girish Sahani wrote:
Thanks!It workedi wasted a lot of time trying to find a bug in my
code...what is wrong in iterating over a list and modifying it?
Doesnt python take the modified list every time the loop starts?
this is explained in the tutorial, under the for statement:
The for
12 matches
Mail list logo