Hi there, I have a 2 lists.. for simplicities sake lets say the are:
l1 = [ 'abc' 'ghi' 'mno' ]
l2 = [ 'abc' 'def' 'ghi' 'jkl 'mno' 'pqr']
what I need to do is compare l1 against l2 and return the "position"
of where each object in l1 is in l2
ie: pos = 0, 2, 4
Thanks in advance, -h
--
http
On Jun 22, 1:46 am, Charles Sanders <[EMAIL PROTECTED]>
wrote:
> Paul Rubin wrote:
>
> > from itertools import izip
> > pos = map(dict(izip(l2, count())).__getitem__, l1)
>
> or probably less efficiently ...
>
> >>> l1 = [ 'abc', 'ghi', 'mno' ]
> >>> l2 = [ 'abc', 'def', 'ghi', 'jkl', 'mno', 'pqr
On Jun 22, 2:16 am, hiro <[EMAIL PROTECTED]> wrote:
> On Jun 22, 1:46 am, Charles Sanders <[EMAIL PROTECTED]>
> wrote:
>
> > Paul Rubin wrote:
>
> > > from itertools import izip
> > > pos = map(dict(izip(l2, count())).__getitem__, l1)
>
> >
On Jun 22, 1:56 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, 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
On Jun 22, 1:58 pm, hiro <[EMAIL PROTECTED]> wrote:
> On Jun 22, 1:56 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>
>
>
> > In <[EMAIL PROTECTED]>, hiro wrote:
> > > Hi once again, Charles.. I have tried your approach in my data
On Jun 22, 2:00 pm, hiro <[EMAIL PROTECTED]> wrote:
> On Jun 22, 1:58 pm, hiro <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jun 22, 1:56 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>
> > > In <[EMAIL PROTECTED]>, hiro wrote:
&
Hi there,
I'm very new to python, the problem I need to solve is whats the "best/
simplest/cleanest" way to read in multiple files (ascii), do stuff to
them, and write them out(ascii).
--
import os
filePath = ('O:/spam/eggs/')
for file in os.listdir(filePath): #straight from docs
# iterate
Thanks a lot for the help guys, I'm at work right now and I will go
over your suggestions one by one this weekend. Being more alert now,
taking a look at the examples you posted, I now see how to approach
this problem. The thing with python that I'm starting to realize is
that there are a million
Thanks a lot for the help guys, I'm at work right now and I will go
over your suggestions one by one this weekend. Being more alert now,
taking a look at the examples you posted, I now see how to approach
this problem. The thing with python that I'm starting to realize is
that there are a million
Hey there, I'm currently doing data preprocessing (generating lagged
values for a time series) and I'm having some difficulties trying to
write a file to disk. A friend of mine, wrote this quick example for
me:
---
10 matches
Mail list logo