comparing two lists and returning "position"

hiro NunezD at gmail.com
Fri Jun 22 15:28:49 EDT 2007


On Jun 22, 2:00 pm, hiro <Nun... at gmail.com> wrote:
> On Jun 22, 1:58 pm, hiro <Nun... at gmail.com> wrote:
>
>
>
> > On Jun 22, 1:56 pm, Marc 'BlackJack' Rintsch <bj_... at gmx.net> wrote:
>
> > > In <1182534010.884992.119... at u2g2000hsc.googlegroups.com>, hiro wrote:
> > > > Hi once again, Charles.. I have tried your approach in my data set l2
> > > > and it keeps crashing on me,
> > > > bare in mind that I have a little over 10 million objects in my list
> > > > (l2) and l1 contains around 4 thousand
> > > > objects.. (i have enough ram in my computer so memory is not a
> > > > problem)
>
> > > > python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
> > > > (Intel)] on win32
>
> > > > error is : ValueError: list.index(x): x not in list
>
> > > So you are saying you get this error with the value of `x` actually in the
> > > list!?  Somehow hard to believe.
>
> > > Ciao,
> > >         Marc 'BlackJack' Rintsch
>
> > yes I do
>
> I doubled, trippled check my data already (even doing a search by hand
> using vim) and the data is fine.  Still looking into it though


hahaha, K found out what was wrong.. in the function computing
the data for l1 there was extra space was being put in.

ie:

l1 = [ 'abc ' 'ghi ' 'mno ' ]

and I didn't strip it properly after splitting it.. silly me,

well.. live and learn.. thanks guys

Cheers, -h




More information about the Python-list mailing list