>>>>> hoffik <be...@seznam.cz> (h) wrote: >h> Hello,
>h> I'm quite new in Python and I have one question. I have a 2D matrix of >h> values stored in list (3 columns, many rows). I wonder if I can select one >h> column without having to go through the list with 'for' command. >h> For example I have list called 'values'. >h> When I write 'values[0]' or 'values[0][:]' I'll get the first row. >h> But when I write 'values[:][0]' I won't get the first column, but the first >h> row again! I can't see why. If you work with matrices, numpy may be interesting for you. It does have the required functionality: M[:,0] will give you the first column. -- Piet van Oostrum <p...@cs.uu.nl> URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4] Private email: p...@vanoostrum.org -- http://mail.python.org/mailman/listinfo/python-list