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
Harlin Seritt wrote:
Roy, I like what you showed: nums = [a for a in range(100)] . My
mistake for not expressing my question as well as I should have. Not
only am I looking for a way to fill in 100 spots (more or less) in an
array er... list, but I'd like to be able to do it in intervals of
2,
Will McGugan wrote:
Warren Postma wrote:
Will McGugan wrote:
Isn't that equivalent to simply..
nums= range(100)
I remember the day I first realized that 900 lines of some C++ program
I was working on could be expressed in three lines of python. Ahh.
Lately I've found myself commenting C++ code
Warren Postma wrote:
Will McGugan wrote:
Isn't that equivalent to simply..
nums= range(100)
I remember the day I first realized that 900 lines of some C++ program I
was working on could be expressed in three lines of python. Ahh.
Lately I've found myself commenting C++ code with the equivalent P
Harlin Seritt wrote:
Roy, I like what you showed: nums = [a for a in range(100)] . My
mistake for not expressing my question as well as I should have. Not
only am I looking for a way to fill in 100 spots (more or less) in an
array er... list, but I'd like to be able to do it in intervals of
2,
Excellent point Warren. I have been working with Python for about 3
years in all, but only really seriously for about a year. I am still
utterly amazed that near everything that takes me about 5 to 20 lines
of code can be done in 1, 2 or 3 lines of Python code (when done
correctly). It is very frus
Will McGugan wrote:
Isn't that equivalent to simply..
nums= range(100)
I remember the day I first realized that 900 lines of some C++ program I
was working on could be expressed in three lines of python. Ahh.
Rebirth. Then there was the phase of the python-newbie so enamored of
map and lambda.
Harlin Seritt <[EMAIL PROTECTED]> wrote:
>I've got the following code:
>
>nums = range(0)
>for a in range(100):
> nums.append(a)
>
>Is there a better way to have num initialized to a list of 100
>consecutive int values?
Step one would be to change the first line to
nums = []
which is simpler a
Harlin Seritt wrote:
I've got the following code:
nums = range(0)
for a in range(100):
nums.append(a)
Is there a better way to have num initialized to a list of 100
consecutive int values?
You mean like this?
nums = range(100)
;-)
--
--
Harlin Seritt wrote:
I've got the following code:
nums = range(0)
for a in range(100):
nums.append(a)
Is there a better way to have num initialized to a list of 100
consecutive int values?
Why not the simplest solution?
a = range(100)
regards
Steve
--
http://mail.python.org/mailman/listinfo/p
Harlin Seritt wrote:
I've got the following code:
nums = range(0)
for a in range(100):
nums.append(a)
Is there a better way to have num initialized to a list of 100
consecutive int values?
Isn't that equivalent to simply..
nums= range(100)
Will McGugan
--
http://mail.python.org/mailman/listinfo/
I've got the following code:
nums = range(0)
for a in range(100):
nums.append(a)
Is there a better way to have num initialized to a list of 100
consecutive int values?
Thanks,
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
19 matches
Mail list logo