Ah, so using Sage you have to import the ix_ function separately, where apparently in the enthought distribution you dont have to. Although now Sage is telling me that the entries I have in the variable 'b' need to be integers (which I think has to do with the fact that I am running Sage 4.1 as I think I have run into that particular problem before and it was fixed roughly 2 weeks after I installed Sage).
Thanks, Joe On Sep 23, 2:19 pm, Jason Grout <jason-s...@creativetrax.com> wrote: > Joe wrote: > > Hey, I have some code that I wrote with my Enthought python > > distribution on my laptop which uses the ix_ command for arrays and > > matrices in numpy, for example: > > > a=array([1,2,3,4,5,6]) > > b=[3,4] > > a[ix_(b)] > > > gives: array([4,5]) > > > but when using Sage on the computers at work it does not recognize > > this command (regardless of whether I start up in sage, python, or > > ipython). > > This seems to work fine for me on sagenb.org. Do you have the most > recent version of Sage? > > sage: from numpy import ix_ > sage: a=array([1,2,3,4,5,6]) > sage: b=[3,4] > sage: a[ix_(b)] > array([4, 5]) > > Jason > > -- > Jason Grout --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---