From: Travis O. <oli...@ie...> - 2006-07-11 01:46:26
|
Tom Denniston wrote: > The following works on a float array but not an object array. It > gives a very strange error message. > > (Pdb) numpy.log(numpy.array([19155613843.7], dtype=object)) > *** AttributeError: 'float' object has no attribute 'log' > This is expected behavior. For object arrays the ufuncs look to the objects themselves for implementation. In this case. The ufunc tries to call the log method of each entry in the array. The first entry is a float (which as the error shows) does not have a log attribute and so you get a failure. -Travis |