8000 BUG: removed unnecesary warning from financial.pmt method by githubmlai · Pull Request #6073 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: removed unnecesary warning from financial.pmt method #6073

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

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions numpy/lib/financial.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ def pmt(rate, nper, pv, fv=0, when='end'):
# use different payment if rate == 0
zero_rate_mask = (rate == 0)
compounded_rate = (1 + rate)**nper
payment = np.asarray(np.divide(-(fv + pv*compounded_rate)*rate,
(1 + rate*when)*(compounded_rate - 1),
payment = np.asarray(np.divide(-(fv + pv * compounded_rate) * rate,
(1 + rate * when) * (compounded_rate - 1),
where=~zero_rate_mask))
np.copyto(payment, -(fv + pv)/nper, where=zero_rate_mask)
np.copyto(payment, -(fv + pv) / nper, where=zero_rate_mask)
return payment

def nper(rate, pmt, pv, fv=0, when='end'):
Expand Down
0