Matrix (list-in-list), how to get a column?
F. Petitjean
littlejohn.75 at noos.fr
Thu Oct 21 12:56:13 EDT 2004
On Thu, 21 Oct 2004 12:10:50 -0400, Russell Blau <russblau at hotmail.com> wrote:
> "F. Petitjean" <littlejohn.75 at noos.fr> wrote in message
> news:4177d9e5$0$842$626a14ce at news.free.fr...
>> On Thu, 21 Oct 2004 17:19:04 +0200, Arvid Andersson <arvid at linux.se>
> wrote:
>> >
>> > I have some data that looks like this:
>> > data = [[1, 2], [3, 4], [5, 6]]
>> >
> ...
>> >>> import Numeric as N
> ...
>
>> Hope that helps. Don't hesitate to try directly at the interpreter
>> prompt.
>
> Ok, let's see what happens:
>
>>>> import Numeric as n
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> ImportError: No module named Numeric
>
> I think you left out a step in your instructions.... ;-)
>
Numeric is the name of the "Numeric python" package aka Numpy.
I think that you can find it on sourceforge.net, alongside a new version
called Numarray. So, The numeric arrays are interesting as they store
homogeneous items (typically integers or floats) and can have multiple
dimensions. Slicing (pts[:,1] for instance) is very convenient.
Regards.
More information about the Python-list
mailing list