Wes McKinney writes:
> Did you mean to post a different link? That's the ticket I just created :)
How silly of me! I meant http://projects.scipy.org/numpy/ticket/1427
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/ma
This memory leak may be related: http://projects.scipy.org/numpy/ticket/1542
It shows what appears to be a memory leak when calling astype('float')
on an array of dtype 'object'.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.sci
Pierre, Thank you for the wonderful explanation.
I get it! np.alltrue(idx.data == idx2.data) is False.
PS. Thank you for closing ticket #1447; sorry for the trouble.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mail
Is this behavior of masked arrays intended, or is it a bug?
This part works as I would expected:
import numpy as np
a=np.ma.fix_invalid(np.array([np.nan,-1,0,1]))
b=np.ma.fix_invalid(np.array([np.nan,-1,0,1]))
idx=(a==b)
print(a[idx][3])
# 1.0
Note that a[idx] has shape (4,).
But if I change t
Okay; thank you very much for the explanation.
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Thanks for the quick response.
In http://www.scipy.org/Cookbook/Indexing
I see
>>> a = C[1,2,3]
>>> a
23
>>> type(a)
>>> type(int(a))
>>> a**a
Warning: overflow encountered in long_scalars
-1276351769
>>> int(a)**int(a)
20880467999847912034355032910567L
This shows numpy can catch an overflow ge
import numpy as np
import operator
np.seterr(all='raise')
a=np.arange(1)+1
print(a.dtype)
# int32
for num in range(1,17):
a=np.arange(num)+1
b=np.multiply.reduce(a)
print('%s! = %s'%(num,b))
# c=reduce(operator.mul,range(1,num+1))
# assert(b==c)
The code above outputs
int32
1!