New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ufunc generates unintuitive AttributeError on object arrays (Trac #1013) #1611
Comments
@rkern wrote on 2009-02-20 Can you suggest an error message text that you would have been more helpful? |
Milestone changed to |
Title changed from |
Perhaps a better error message is:
(I think it should TypeError rather than an AttributeError...?) When passing an array of strings to
I think this would also be improved with the above - more descriptive - message. |
The reason for the AttributeError is that as a last ditch attempt, np.log I agree the message is tremendously confusing though and it's bitten me
|
Will have a look into it (probably sometime next week)... |
@hayd Still pursuing this? |
#368 seems related / duplicate. |
Can anyone point me and/or @hayd to where in the code this can be fixed. I spent some time looking, but I don't understand the numpy internals well enough yet.... |
|
Closed in #12700 |
Original ticket http://projects.scipy.org/numpy/ticket/1013 on 2009-02-20 by @wesm, assigned to unknown.
This error is very unintuitive for end-users, arrays formed from SQL query results can frequently end up as object arrays by accident.
In [15]: arr = np.random.randn(100).astype(object)
In [16]: np.log(arr)
AttributeError Traceback (most recent call last)
H:\workspace\Python\src in ()
AttributeError: log
Same AttributeError is raised for other ufuncs
The text was updated successfully, but these errors were encountered: