[IPython-user] numpy.array question (and ILeo plugging)

Ville M. Vainio vivainio@gmail....
Wed Mar 12 11:10:30 CDT 2008


I thought I could post this here, instead of joining the actual
mailing list (this is elementary stuff). As an aside, I thought I
could make an effort to plug ILeo ;-)

I'm trying to make it as convenient as possible to edit numpy.array
objects in ILeo. It kind of works:

[C:opt/Console2]|19> a = array([[1,2,3], [4,5,6]])
[C:opt/Console2]|21> %lee a

This sets the body of a node called 'a' to

@cl
array([[1, 2, 3],
       [4, 5, 6]])

You can edit the node to your liking and press alt+I to reassign it to
variable 'a'.

However, printing the array gives nicer formatting:

[C:opt/Console2]|22> print a
[[1 2 3]
 [4 5 6]]

And I'd like to enable leo editing of numarrays in this syntax.

Is there a feature in numpy that allows me to import a string like
that as array, or do I have to write it myself?

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'


More information about the IPython-user mailing list