On Tue, 06 Oct 2015 20:20:40 +0200, Peter Otten wrote:
> Jaydip Chakrabarty wrote:
>
>> On Tue, 06 Oct 2015 14:33:51 +0200, Peter Otten wrote:
>>
>>> Jaydip Chakrabarty wrote:
>>>
On Tue, 06 Oct 2015 01:34:17 +1100, Chris Angelico wrote:
> On Tue, Oct 6, 2015 at 1:06 AM, Tim Chas
Peter Otten wrote:
> I really meant it when I asked you to post the code you actually ran, and
> the traceback it produces.
Anyway, here's a complete script that should work. It uses indices instead
names, but the underlying logic is the same.
#!/usr/bin/env python
import csv
import sys
from co
On Tue, 06 Oct 2015 19:25:12 +0100, MRAB wrote:
> On 2015-10-06 18:23, Jaydip Chakrabarty wrote:
>> On Tue, 06 Oct 2015 14:33:51 +0200, Peter Otten wrote:
>>
> [snip]
>>
>> I downloaded gmail contacts in google csv format. There are so many
>> columns. So I was trying to create another csv with th
On 2015-10-06 18:23, Jaydip Chakrabarty wrote:
On Tue, 06 Oct 2015 14:33:51 +0200, Peter Otten wrote:
[snip]
I downloaded gmail contacts in google csv format. There are so many
columns. So I was trying to create another csv with the required columns.
Now when I tried to open the gmail csv fil
Jaydip Chakrabarty wrote:
> On Tue, 06 Oct 2015 14:33:51 +0200, Peter Otten wrote:
>
>> Jaydip Chakrabarty wrote:
>>
>>> On Tue, 06 Oct 2015 01:34:17 +1100, Chris Angelico wrote:
>>>
On Tue, Oct 6, 2015 at 1:06 AM, Tim Chase
wrote:
> That way, if you determine by line 3 that your
On Tue, 06 Oct 2015 14:33:51 +0200, Peter Otten wrote:
> Jaydip Chakrabarty wrote:
>
>> On Tue, 06 Oct 2015 01:34:17 +1100, Chris Angelico wrote:
>>
>>> On Tue, Oct 6, 2015 at 1:06 AM, Tim Chase
>>> wrote:
That way, if you determine by line 3 that your million-row CSV file
has no blan
On 2015-10-06 12:24, Jaydip Chakrabarty wrote:
On Tue, 06 Oct 2015 01:34:17 +1100, Chris Angelico wrote:
On Tue, Oct 6, 2015 at 1:06 AM, Tim Chase
wrote:
That way, if you determine by line 3 that your million-row CSV file has
no blank columns, you can get away with not processing all million
Jaydip Chakrabarty wrote:
> On Tue, 06 Oct 2015 01:34:17 +1100, Chris Angelico wrote:
>
>> On Tue, Oct 6, 2015 at 1:06 AM, Tim Chase
>> wrote:
>>> That way, if you determine by line 3 that your million-row CSV file has
>>> no blank columns, you can get away with not processing all million
>>> ro
On Tue, 06 Oct 2015 01:34:17 +1100, Chris Angelico wrote:
> On Tue, Oct 6, 2015 at 1:06 AM, Tim Chase
> wrote:
>> That way, if you determine by line 3 that your million-row CSV file has
>> no blank columns, you can get away with not processing all million
>> rows.
>
> Sure, although that effecti
On Mon, 05 Oct 2015 13:29:03 +, Jaydip Chakrabarty wrote:
> Hello,
>
> I have a csv file like this.
>
> Name,Surname,Age,Sex abc,def,,M ,ghi,,F jkl,mno,,
> pqr,,,F
>
> I want to find out the blank columns, that is, fields where all the
> values are blank. Here is my python code.
>
> fn = "
On 10/05/2015 03:29 PM, Jaydip Chakrabarty wrote:
Hello,
I have a csv file like this.
Name,Surname,Age,Sex
abc,def,,M
,ghi,,F
jkl,mno,,
pqr,,,F
I want to find out the blank columns, that is, fields where all the
values are blank. Here is my python code.
fn = "tmp1.csv"
fin = open(fn, 'rb')
On Tue, Oct 6, 2015 at 1:06 AM, Tim Chase wrote:
> That way, if you determine by line 3 that your million-row CSV file
> has no blank columns, you can get away with not processing all
> million rows.
Sure, although that effectively means the entire job is moot. I kinda
assume that the OP knows th
On 2015-10-06 00:51, Chris Angelico wrote:
> fn = "tmp1.csv"
> fin = open(fn, 'rb')
> rdr = csv.DictReader(fin, delimiter=',')
> # all the same down to here
> blanks = set(rdr.fieldnames)
> for row in rdr:
> blanks = {col for col in blanks if not row[col]}
> mt = [col for col in rdr.fieldnames
On Mon, Oct 5, 2015, at 09:29, Jaydip Chakrabarty wrote:
> Hello,
>
> I have a csv file like this.
>
> Name,Surname,Age,Sex
> abc,def,,M
> ,ghi,,F
> jkl,mno,,
> pqr,,,F
>
> I want to find out the blank columns, that is, fields where all the
> values are blank. Here is my python code.
>
> fn =
On Tue, Oct 6, 2015 at 12:48 AM, Chris Angelico wrote:
> fn = "tmp1.csv"
> fin = open(fn, 'rb')
> rdr = csv.DictReader(fin, delimiter=',')
> # all the same down to here
> blanks = set(rdr.fieldnames)
> for row in data:
> blanks = {col for col in blanks if not row[col]}
> mt = [col for col in r
On Tue, Oct 6, 2015 at 12:29 AM, Jaydip Chakrabarty
wrote:
> I want to find out the blank columns, that is, fields where all the
> values are blank. Here is my python code.
>
> fn = "tmp1.csv"
> fin = open(fn, 'rb')
> rdr = csv.DictReader(fin, delimiter=',')
> data = list(rdr)
> flds = rdr.fieldna
Hello,
I have a csv file like this.
Name,Surname,Age,Sex
abc,def,,M
,ghi,,F
jkl,mno,,
pqr,,,F
I want to find out the blank columns, that is, fields where all the
values are blank. Here is my python code.
fn = "tmp1.csv"
fin = open(fn, 'rb')
rdr = csv.DictReader(fin, delimiter=',')
data = list(
17 matches
Mail list logo