On Sun, 10 Aug 2008 21:40:55 -0700, Mensanator wrote:
On Aug 10, 11:18�pm, ssecorp [EMAIL PROTECTED] wrote:
Is there a syntax for looping through 2 iterables at the same time?
for x in y:
� � for a in b:
is not what I want.
I want:
for x in y and for a in b:
Something like this?
a
ssecorp [EMAIL PROTECTED] writes:
for x in y and for a in b:
for x,a in zip(y,b): ...
or the iterator version:
from itertools import izip
for x,a in izip(y,b): ...
avoids allocating a list to iterate through.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 11, 6:40 am, Mensanator [EMAIL PROTECTED] wrote:
On Aug 10, 11:18 pm, ssecorp [EMAIL PROTECTED] wrote:
Is there a syntax for looping through 2 iterables at the same time?
for x in y:
for a in b:
is not what I want.
I want:
for x in y and for a in b:
Something like this?
On Aug 11, 5:40 am, Mensanator [EMAIL PROTECTED] wrote:
On Aug 10, 11:18 pm, ssecorp [EMAIL PROTECTED] wrote:
Is there a syntax for looping through 2 iterables at the same time?
for x in y:
for a in b:
is not what I want.
I want:
for x in y and for a in b:
Something like this?
On Aug 10, 11:14 pm, ssecorp [EMAIL PROTECTED] wrote:
On Aug 11, 6:40 am, Mensanator [EMAIL PROTECTED] wrote:
On Aug 10, 11:18 pm, ssecorp [EMAIL PROTECTED] wrote:
Is there a syntax for looping through 2 iterables at the same time?
for x in y:
for a in b:
is not what I want.
On Sun, 10 Aug 2008 23:14:50 -0700, ssecorp wrote:
I know zip but lets say I have a word painter and I want to compare it
to a customer's spelling, he might have written paintor and I want to
check how many letters are the same.
Now I know how I could do this, it is not hard. I am just
sounds like *soundex* is what you are looking for. google soundex
regards
Edwin
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Marc 'BlackJack' Rintsch
Sent: Monday, August 11, 2008 3:09 AM
To: python-list@python.org
Subject: Re: for x,y in word1
My first thought is that you should be looking at implementations of
Hamming Distance. If you are actually looking for something like
SOUNDEX you might also want to look at the double metaphor algorithm,
which is significantly harder to implement but provides better
matching and is less
On Mon, Aug 11, 2008 at 8:44 AM, Casey [EMAIL PROTECTED] wrote:
My first thought is that you should be looking at implementations of
Hamming Distance. If you are actually looking for something like
SOUNDEX you might also want to look at the double metaphor algorithm,
which is significantly
Thanks, Timothy. I'm pretty sure that there is no such thing as a beautiful
implementation of double-metaphone but I would personally like to have a copy
of your python implementation. I have a fairly elegant version of the original
metaphone algorithm I wrote myself (in PERL, many years ago)
On Mon, Aug 11, 2008 at 12:13 PM, Dave Webster [EMAIL PROTECTED] wrote:
Thanks, Timothy. I'm pretty sure that there is no such thing as a beautiful
implementation of double-metaphone but I would personally like to have a copy
of your python implementation. I have a fairly elegant version of
Is there a syntax for looping through 2 iterables at the same time?
for x in y:
for a in b:
is not what I want.
I want:
for x in y and for a in b:
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 10, 11:18�pm, ssecorp [EMAIL PROTECTED] wrote:
Is there a syntax for looping through 2 iterables at the same time?
for x in y:
� � for a in b:
is not what I want.
I want:
for x in y and for a in b:
Something like this?
a = ['a','b','c']
b = [1,2,3]
zip(a,b)
[('a', 1), ('b',
13 matches
Mail list logo