[Numpy-discussion] shape, size
by Daniel Holth other posts by this author
Jan 30 2004 4:12AM messages near this date
[Numpy-discussion] shape, size
|
Re: [Numpy-discussion] shape, size
In python, if na is a numarray:
> >> na
array([[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0],
[1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]])
I can type
> >> nb = na[:,:4]
> >> nb
array([[0, 1, 0, 1],
[1, 0, 1, 0]])
> >> nb[0][0]=17
> >> na
array([[17, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0],
[ 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1]])
nb and na share data.
How do you write nb = na[:,:4] in a C extension module?
Thanks,
Daniel Holth
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@[...].net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion
Thread:
Daniel Holth
Todd Miller
|