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

numpy irr should check whether the masked solution is empty #6744

Closed
jburroni opened this issue Nov 28, 2015 · 0 comments
Closed

numpy irr should check whether the masked solution is empty #6744

jburroni opened this issue Nov 28, 2015 · 0 comments
Labels

Comments

@jburroni
Copy link

In the current implementation, when no solution is returned by roots, the function return np.nan. But if no real solution is returned, the function fails with an exception:

ValueError: attempt to get argmin of an empty sequence

The proposed fix is to add the following to https://github.com/numpy/numpy/blob/master/numpy/lib/financial.py#L654

if res.size == 0 or res[mask].size == 0:
@charris charris changed the title numpy irr should check weather the masked solution is empty numpy irr should check whether the masked solution is empty Nov 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants