Tom Johnson wrote: > Hi, I'm having some troubles with long. > > >>>> from numpy import log >>>> log(8463186938969424928L) >>>> > 43.5822574833 > >>>> log(10454852688145851272L) >>>> > <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 log(float(10454852688145851272L)) -Travis O. _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
