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

better error message for np.poly(np.zeros((0,0))) (Trac #1495) #2092

Closed
thouis opened this issue Oct 19, 2012 · 2 comments · Fixed by #4498
Closed

better error message for np.poly(np.zeros((0,0))) (Trac #1495) #2092

thouis opened this issue Oct 19, 2012 · 2 comments · Fixed by #4498

Comments

@thouis
Copy link
Contributor

thouis commented Oct 19, 2012

Original ticket http://projects.scipy.org/numpy/ticket/1495 on 2010-05-28 by @josef-pkt, assigned to unknown.

np.poly(np.zeros((0,0))) crashed with numpy 1.4.0 but has been fixed in trunk (2.0.0)

the error message could be more explicit

In [1]: np.poly(np.zeros((0,0)))
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/home/charris/<ipython console> in <module>()

/usr/local/lib/python2.6/dist-packages/numpy/lib/polynomial.pyc in poly(seq_of_zeros)
    126         pass
    127     else:
--> 128         raise ValueError, "input must be 1d or square 2d array."
    129
    130     if len(seq_of_zeros) == 0:

ValueError: input must be 1d or square 2d array.
@thouis
Copy link
Contributor Author

thouis commented Oct 19, 2012

@rgommers wrote on 2011-03-25

Do you have a suggestion for improved message? Do you want it to tell you the input is 0-D?

@charris
Copy link
Member

charris commented Feb 19, 2014

Because the shape is correct, the error message should complain about an empty array.

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

Successfully merging a pull request may close this issue.

2 participants