print formating for matrix/table

Vincent Davis vincent at vincentdavis.net
Tue Jan 27 03:53:39 CET 2009


I called it a matrix mostly because this is how I am visualizing it. They
are full of numbers but only as representatives of students and schools. It
looks like pprint will work after I read the instructions. At least I know
where to look now. In the end I need to figure out how to save the data a
csv formated for excel but that is for later I was just trying to make
it easier to debug my code.
Thanks
Vincent Davis
720-301-3003


On Mon, Jan 26, 2009 at 7:03 PM, Robert Kern <robert.kern at gmail.com> wrote:

> On 2009-01-26 19:53, Vincent Davis wrote:
>
>> I do have numpy but am using lists as did not need any functions of
>> array. Well maybe print now. I am new to python and don't really know
>> the details about the difference between lists and arrays. I do know
>> that there are different/additional functions available for arrays.
>>
>
> Python lists are one-dimensional, appendable sequences of heterogeneous
> Python objects. numpy arrays are multi-dimensional, non-appendable
> containers usually of homogeneously-typed numerical data (but can also
> contain heterogeneous Python objects, too). numpy arrays have many
> conveniences over lists of lists if you need to do math on bunches of
> numbers.
>
>  Anyway is this the best solution, convert the list to an array before
>> printing?
>>
>
> I wouldn't use numpy *just* for this, but I suspect that you could actually
> use numpy for other things if you are actually using your lists of lists as
> matrices.
>
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma
>  that is made terrible by our own mad attempt to interpret it as though it
> had
>  an underlying truth."
>  -- Umberto Eco
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090126/5c396434/attachment.html>


More information about the Python-list mailing list