On Apr 21, 4:32 pm, Jon Clements wrote:
> On Apr 21, 5:40 pm, nn wrote:
>
>
>
>
>
>
>
>
>
> > time head -100 myfile >/dev/null
>
> > real 0m4.57s
> > user 0m3.81s
> > sys 0m0.74s
>
> > time ./repnullsalt.py '|' myfile
> > 0 1 Null columns:
> > 11, 20, 21, 22, 23, 24, 25, 26, 27, 30
On Apr 21, 5:40 pm, nn wrote:
> time head -100 myfile >/dev/null
>
> real 0m4.57s
> user 0m3.81s
> sys 0m0.74s
>
> time ./repnullsalt.py '|' myfile
> 0 1 Null columns:
> 11, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 33, 45, 50, 68
>
> real 1m28.94s
> user 1m28.11s
> sys 0m0.
time head -100 myfile >/dev/null
real0m4.57s
user0m3.81s
sys 0m0.74s
time ./repnullsalt.py '|' myfile
0 1 Null columns:
11, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 33, 45, 50, 68
real1m28.94s
user1m28.11s
sys 0m0.72s
import sys
def main():
with open(sys.argv[2
Is your product ID always the 3rd and last item on the line ?
Else your output won't separate IDs.
And how does
output = open(output_file,'w')
for x in set(line.split(',')[2] for line in open(input_file)) :
output.write(x)
output.close()
behave ?
[EMAIL PROTECTED] wrote:
I have a csv fil
On Tue, 5 Aug 2008, [EMAIL PROTECTED] wrote:
> I have a csv file containing product information that is 700+ MB in
> size. I'm trying to go through and pull out unique product ID's only
> as there are a lot of multiples. My problem is that I am appending the
> ProductID to an array and then search
Why not just use sets?
a = set()
a.add(1)
a.add(2)
On Tue, Aug 5, 2008 at 10:14 PM, RPM1 <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
>>
>> I have a csv file containing product information that is 700+ MB in
>> size. I'm trying to go through and pull out unique product ID's only
>> as th
[EMAIL PROTECTED] wrote:
I have a csv file containing product information that is 700+ MB in
size. I'm trying to go through and pull out unique product ID's only
as there are a lot of multiples. My problem is that I am appending the
ProductID to an array and then searching through that array each
Avinash Vora wrote:
On Aug 5, 2008, at 10:00 PM, [EMAIL PROTECTED] wrote:
I have a csv file containing product information that is 700+ MB in
size. I'm trying to go through and pull out unique product ID's only
as there are a lot of multiples. My problem is that I am appending the
ProductID to
On Aug 5, 2008, at 10:00 PM, [EMAIL PROTECTED] wrote:
I have a csv file containing product information that is 700+ MB in
size. I'm trying to go through and pull out unique product ID's only
as there are a lot of multiples. My problem is that I am appending the
ProductID to an array and then sea
[EMAIL PROTECTED] wrote:
I have a csv file containing product information that is 700+ MB in
size. I'm trying to go through and pull out unique product ID's only
as there are a lot of multiples. My problem is that I am appending the
ProductID to an array and then searching through that array each
I have a csv file containing product information that is 700+ MB in
size. I'm trying to go through and pull out unique product ID's only
as there are a lot of multiples. My problem is that I am appending the
ProductID to an array and then searching through that array each time
to see if I've seen t
"stasz" wrote:
> > hmm, there's lots of ways, huh? you can use itertools.zip instead of
> > builtin zip, or do:
> >
> > map(None, list1, list2)
>
> Not!
huh?
> One should try a possible solution first,
> >>> l1 = range(10)
> >>> l2 = range(10,20)
> >>> l1
> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
> >>>
On Tue, 10 May 2005 18:11:27 -0700, gene.tani wrote:
> hmm, there's lots of ways, huh? you can use itertools.zip instead of
> builtin zip, or do:
>
> map(None, list1, list2)
Not!
One should try a possible solution first,
>>> l1 = range(10)
>>> l2 = range(10,20)
>>> l1
[0, 1, 2, 3, 4, 5, 6, 7, 8
For efficient string concatenation in python look at:
http://www.skymind.com/~ocrow/python_string
--
http://mail.python.org/mailman/listinfo/python-list
hmm, there's lots of ways, huh? you can use itertools.zip instead of
builtin zip, or do:
map(None, list1, list2)
, which will pad the shorter one to match the longer one.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> If I simplify the problem, suppose I have 2 lists like:
>
> a = range(10)
> b = range(20,30)
>
> What I would like to have, is a "union" of the 2 list in a
> single tuple. In other words (Python words...):
>
> c = (0, 20, 1, 21, 2, 22, 3, 23, 4, 24, 5, 25, .
If the
[EMAIL PROTECTED] wrote:
> If I simplify the problem, suppose I have 2 lists like:
>
> a = range(10)
> b = range(20,30)
>
> What I would like to have, is a "union" of the 2 list in a single tuple. In
> other words (Python words...):
>
> c = (0, 20, 1, 21, 2, 22, 3, 23, 4, 24, 5, 25, .
py> a
andrea.gavana wrote:
> If I simplify the problem, suppose I have 2 lists like:
>
> a = range(10)
> b = range(20,30)
>
> What I would like to have, is a "union" of the 2 list in a single tuple. In
> other words (Python words...):
>
> c = (0, 20, 1, 21, 2, 22, 3, 23, 4, 24, 5, 25, .
The 'yiel
[EMAIL PROTECTED] wrote:
> If I simplify the problem, suppose I have 2 lists like:
>
> a = range(10)
> b = range(20,30)
>
> What I would like to have, is a "union" of the 2 list in a single tuple. In
> other words (Python words...):
>
> c = (0, 20, 1, 21, 2, 22, 3, 23, 4, 24, 5, 25, .
>
> and
On 5/10/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello NG,
>
> it is probably a beginner question, but I didn't solve it without
> for-loops, and I am unable to determine if there is a faster way (probably
> using some built-in function) to do this
Hello NG,
it is probably a beginner question, but I didn't solve it without
for-loops, and I am unable to determine if there is a faster way (probably
using some built-in function) to do this task. I have to speed up a
wxPython code that uses a lot of string concatenation (and uses
21 matches
Mail list logo