On 7/23/12 9:10 AM, Urs Hackstein wrote:
Well,

if

data=[[1, 2], [3, 4]]

then data[:,-2:] gives

Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "_sage_input_25.py", line 10, in <module>

     exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + 
_support_.preparse_worksheet_cell(base64.b64decode("ZGF0YVs6LC0yOl0="),globals())+"\\n"); 
execfile(os.path.abspath("___code___.py"))

   File "", line 1, in <module>

   File "/tmp/tmp4c8jhA/___code___.py", line 3, in <module>
     exec compile(u'data[:,-_sage_const_2 :]
   File "", line 1, in <module>


TypeError: list indices must be integers, not tuple

Try:

data[:,-2r:] or data[:,int(-2):]

Apparently numpy has problems with the Sage integer types.

Jason


--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to