I'm not sure which numpy version you're using (I don't get that using numpy 1.14.3), but the issue is that for some reason the data type (dtype) of the array is being assumed to be a 4 byte integer or '<i4'. The maximum value for that is 2,147,483,647 whereas 1999**3 = 7,988,005,999. To get the correct result you can specify the dtype: a = np.arange(2000,dtype='<i8')**3 for example.
On Tue, Jan 29, 2019 at 2:54 AM firstname.lastname@example.org wrote:
From: Yuping Wang email@example.com To: firstname.lastname@example.org Cc: Bcc: Date: Tue, 29 Jan 2019 15:22:00 +0800 (CST) Subject: [Numpy-discussion] Numpy-discussion Dear Nmupy developers and users: I am a new user of Numpy ,I have encountered a question about Numpy recently, which need your help. The question is below:
I don know why there are negative numbers can somebody explain to me why these happens Thanks in advance!
NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion