
Hi, I have occasionally dabbled with numpy in the past, but I'm starting to use it more heavily now. I have two (minor, I think) question/comments: 1) RandomArray seems to be initialized from the time. At least when I repeatedly execute a script that uses RandomArray.uniform, the first number generated changes very little from one invocation to another. For example, with the following file: --------- # testRA.py from RandomArray import * print uniform(-1.0, 1.0) --------- I get: -------- cholla 192% python testRA.py 0.434084415436 cholla 193% python testRA.py 0.433970689774 cholla 194% python testRA.py 0.433856964111 cholla 195% python testRA.py 0.433781266212 -------- Is that really desirable behavior? It is easily fixed in my script; I just generate one random number first and throw it away. (I'm running on a sparc under solaris 2.6.) 2) The example in the documentation on negative strides in slices is incorrect, or old. It says:
a = reshape(arrayrange(9),(3,3)) print a[2:-1, 0] [6 3 0]
That's not the result I get. I think two colons were wanted there. Clay

-----Original Message----- From: numpy-discussion-admin@lists.sourceforge.net [mailto:numpy-discussion-admin@lists.sourceforge.net]On Behalf Of Clay Spence Sent: Thursday, April 12, 2001 8:13 AM To: numpy-discussion Subject: [Numpy-discussion] RandArray initialization and docs <snip> 2) The example in the documentation on negative strides in slices is incorrect, or old. It says:
a = reshape(arrayrange(9),(3,3)) print a[2:-1, 0] [6 3 0]
That's not the result I get. I think two colons were wanted there. --- Corrected in my sources, thank you. The change will migrate into the next release of the manual.
participants (2)
-
Clay Spence
-
Paul F. Dubois