-
Notifications
You must be signed in to change notification settings - Fork 237
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
analyze methods do not allow Y as a list #70
Comments
Best to use an 'assert' command? On 31 Jul 2015 8:41 pm, Jon Herman [email protected] wrote: currently required to be a numpy array. Could add a simple check at the beginning of every method, if type(Y) is list: Y = np.array(Y) — |
Hey Will. Does assert always need to throw an error when the assertion fails? In this case I think it'd be better to silently convert to np.array. |
I don't think there is any issue with the methods failing if they're not called with the correct type arguments. An |
Hey Will. I originally brought this issue up with Jon, as I ran into errors trying to pass in a list. I'd be fine with the software failing, but it should produce a better error message. Below is the current error message:
|
Thanks Dave. I don't have a preference either way, as long as all of the methods are modified consistently. (Maybe this falls under the general need for improved error messages). Something I noticed, numpy will always cast a list to a np-array if you pass it into a function instead of using the object attributes. So for example:
So maybe the easiest thing to do is switch to np.* functions instead of object attributes throughout. |
Hmm. I understand now. Or we could just create a 'data cleaning' module for when the command-line interface is used. Then the data will be coerced to the correct type before the functions are called. |
currently required to be a numpy array.
Could add a simple check at the beginning of every method,
if type(Y) is list: Y = np.array(Y)
The text was updated successfully, but these errors were encountered: