Skip to content
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

Incorrect error message in tools.tool? #4332

Open
jbrockmendel opened this issue Mar 11, 2018 · 1 comment
Open

Incorrect error message in tools.tool? #4332

jbrockmendel opened this issue Mar 11, 2018 · 1 comment

Comments

@jbrockmendel
Copy link
Contributor

https://github.com/statsmodels/statsmodels/blob/master/statsmodels/tools/tools.py#L205

    # handle ndarrays and catch array-like for an error
    elif data.__class__ is np.ndarray or not isinstance(data, np.ndarray):
        if not isinstance(data, np.ndarray):
            raise NotImplementedError("Array-like objects are not supported")

The message that Array-like objects are not supported doesn't make sense to me. It looks like it should be the exact opposite: only array-like objects are supported. Am I missing something?

For that matter, is there a reason why the first condition is specifically ndarray without allowing subclasses (i.e. change data.__class__ is np.ndarray to isinstance(data, np.ndarray))?

@josef-pkt
Copy link
Member

I'm not sure. Most likely I never looked at it.

masked arrays and matrices are array_likes that we don't support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants