[Tutor] a code question, but don't know question's name

Kent Johnson kent37 at tds.net
Sun Oct 7 14:44:13 CEST 2007


Alan Gauld wrote:
> The notation data[;,0] doesn't make sense and is an error in Python.
> I#m not sure what you think it does. I assume you simply mean
> data[0]?

[:,0] is an extended slice, not an error:
http://docs.python.org/ref/slicings.html

It is used in Numeric/numpy to select from multidimensional arrays.

Kent


More information about the Tutor mailing list