sandipm wrote:
> hi james,
> this is one implementation using python dictionaries.
>
> report ={}
> for row in data:
> if not row[0] in report:
I'd use:
if row[0] not in report:
> report[row[0]] = [row[0], row[1], 0, 0, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0]
> if row[2]:
>
hi james,
this is one implementation using python dictionaries.
report ={}
for row in data:
if not row[0] in report:
report[row[0]] = [row[0], row[1], 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0]
if row[2]:
report[row[0]][row[2]+1] = row[3]
reports = report.values()
regards,
Sa
On Oct 23, 10:46 pm, james_027 <[EMAIL PROTECTED]> wrote:
> hi,
>
> i have a list from a resultset like this
> 1,"Chicago Bulls",,,""
> 2,"Cleveland Caveliers",,,""
> 4,"Detroit Pistons",1,"23686386.35"
> 4,"Detroit Pistons",2,"21773898.07"
> 4,"Detroit Pistons",3,"12815215.57"
> 4,"Detroit Pistons
hi,
On Oct 24, 1:14 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> On Oct 23, 9:46?pm, james_027 <[EMAIL PROTECTED]> wrote:> hi,
>
> > i have a list from a resultset like this
> > 1,"Chicago Bulls",,,""
> > 2,"Cleveland Caveliers",,,""
>
>^ ^^^ ^
>|
On Oct 23, 9:46?pm, james_027 <[EMAIL PROTECTED]> wrote:
> hi,
>
> i have a list from a resultset like this
> 1,"Chicago Bulls",,,""
> 2,"Cleveland Caveliers",,,""
^ ^^^ ^
| ||| |
1 234 5
How come these records have 5 fields...
hi,
i have a list from a resultset like this
1,"Chicago Bulls",,,""
2,"Cleveland Caveliers",,,""
4,"Detroit Pistons",1,"23686386.35"
4,"Detroit Pistons",2,"21773898.07"
4,"Detroit Pistons",3,"12815215.57"
4,"Detroit Pistons",4,"48522347.76"
4,"Detroit Pistons",5,"28128425.99"
4,"Detroit Pistons",6