Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

list to table

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


jaybode at gmail

Nov 5, 2009, 6:37 AM

Post #1 of 3 (132 views)
Permalink
list to table

Hi All,

Am new to using newgroup for help, but have exhausted my searching
online for a solution

I have a long list of data of associations between values with a value
to that association as follows..

(var) to (var) = (var) hits
A B 1
B A 1
A B 3
B A 3
A C 7
C A 2

And need to build a table as follows that accumulates the above:

row is (from)
column is (to)

A B C
A 0 4 7
B 4 0 0
C 2 0 0

Just can't seam to figure out how to manage this programatically.

Any help or guidance much appreciated !!!


Cheers,


Jay
--
http://mail.python.org/mailman/listinfo/python-list


jjposner at optimum

Nov 6, 2009, 7:44 AM

Post #2 of 3 (121 views)
Permalink
Re: list to table [In reply to]

Gabriel Genellina said:
>
>> Another reason was that §6.2 does explicitly discuss attribute
>> references as targets, but not subscription as target. It would have
>> been more clear to me if all (four?) possible target forms were
>> discussed. Happily you did now discuss that in the part that I
>> snipped above, but would've been nice, and easier for for an
>> other-language-thinking person :-), if it was in documentation.
>
> Yes, probably that section should be improved (except the final
> example added, the text hasn't changed since it was first written,
> more than 9 years ago).
>
FWIW ... following on a discussion in this forum in March of this year
[1], I submitted issue #5621 at bugs.python.org, along with a proposed
rewording of the documentation of this case:

self.x = self.x + 1

I did *not* address the case in which the target is a subscription -- it
wasn't the focus of the forum discussion. IMHO, the subscription case is
much less subject to misunderstanding than the
instance-attribute-vs-class-attribute case. My change was accepted (with
some rearrangements made by Georg Brandl), but has not yet been included
in any Py2 or Py3 release, AFAIK.

-John

[1] http://mail.python.org/pipermail/python-list/2009-March/175054.html

--
http://mail.python.org/mailman/listinfo/python-list


gagsl-py2 at yahoo

Nov 6, 2009, 7:31 PM

Post #3 of 3 (116 views)
Permalink
Re: list to table [In reply to]

En Fri, 06 Nov 2009 12:44:38 -0300, John Posner <jjposner [at] optimum>
escribió:
> Gabriel Genellina said:

>> Yes, probably that section should be improved (except the final example
>> added, the text hasn't changed since it was first written, more than 9
>> years ago).

> FWIW ... following on a discussion in this forum in March of this year I
> submitted issue #5621 at bugs.python.org [...]
> My change was accepted (with some rearrangements made by Georg Brandl),
> but has not yet been included in any Py2 or Py3 release, AFAIK.

That's strange. Your modified text appears in the online version of the
documentation for 2.6.4:
http://www.python.org/doc/2.6.4/reference/simple_stmts.html#assignment-statements
but not in the source package nor the .chm file included in the Windows
binaries for the same release.
Same with 3.1.1

Looks like an error in the build process.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.