Re: comparing two lists and returning "position"

2007-06-22 Thread hiro
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: &

Re: comparing two lists and returning "position"

2007-06-22 Thread hiro
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

Re: comparing two lists and returning "position"

2007-06-22 Thread hiro
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

Re: comparing two lists and returning "position"

2007-06-22 Thread hiro
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) > > >

Re: comparing two lists and returning "position"

2007-06-21 Thread hiro
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

comparing two lists and returning "position"

2007-06-21 Thread hiro
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

Re: python noob, multiple file i/o

2007-03-16 Thread hiro
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

Re: python noob, multiple file i/o

2007-03-16 Thread hiro
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

python noob, multiple file i/o

2007-03-15 Thread hiro
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

file io (lagged values) newbie question

2007-02-19 Thread hiro
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: ---