Skip to content

ENH: Return close results in rate calculation#49

Merged
Kai-Striega merged 1 commit into
numpy:masterfrom
Kai-Striega:nans_rate
Mar 7, 2022
Merged

ENH: Return close results in rate calculation#49
Kai-Striega merged 1 commit into
numpy:masterfrom
Kai-Striega:nans_rate

Conversation

@Kai-Striega
Copy link
Copy Markdown
Member

This PR changes rate to return results for all solutions found that are within tol rather than returning nan if any of the results are found. For example on master running:

import numpy_financial as npf
pv = [-593.06, -4725.38, -662.05, -428.78, -13.65]
fv = [214.07, 4509.97, 224.11, 686.29, -329.67]
print(npf.rate(2, 0, pv, fv))

returns
[nan nan nan nan nan]

the same code now returns

[-0.39920185 -0.02305873 -0.41818459 0.26513414 nan]

This PR closes gh-48

@Kai-Striega Kai-Striega merged commit 2e6ab00 into numpy:master Mar 7, 2022
@Kai-Striega Kai-Striega deleted the nans_rate branch December 14, 2022 09:19
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

Successfully merging this pull request may close these issues.

npf.rate() returns list of all nans where only one input PV/FV pair is problematic

1 participant