[Numpy-discussion] Problems with long
Travis E. Oliphant
Sat Jan 26 06:49:06 CST 2008
Tom Johnson wrote:
> Hi, I'm having some troubles with long.
>>>> from numpy import log
> <type 'exceptions.AttributeError'>: 'long' object has no attribute 'log'
The problem is that the latter long integer is too big to fit into an
int64 (long long) and so it converts it to an object array. The default
behavior of log on object arrays is to look for a method on each element
of the array called log and call that.
Your best bet is to convert to double before calling log
More information about the Numpy-discussion