[Numpy-discussion] Syntax equivalent for np.array()
Gökhan Sever
gokhansever at gmail.com
Wed Feb 10 11:02:22 EST 2010
Hi,
Simple question:
I[4]: a = np.arange(10)
I[5]: b = np.array(5)
I[8]: a*b.cumsum()
O[8]: array([ 0, 5, 10, 15, 20, 25, 30, 35, 40, 45])
I[9]: np.array(a*b).cumsum()
O[9]: array([ 0, 5, 15, 30, 50, 75, 105, 140, 180, 225])
Is there a syntactic equivalent for the I[9] --for instance instead of using
"list" keyword I use [ ] while creating a list. Is there a shortcut for
np.array instead of writing np.array(a*b) explicitly?
Thanks.
--
Gökhan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20100210/8ea2b5cd/attachment.html>
More information about the NumPy-Discussion
mailing list