We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 02979c4 + 9e776e1 commit 7e6663bCopy full SHA for 7e6663b
financial/amortization_table.py
@@ -85,8 +85,12 @@ def amortization_table(
85
amor_table["Remaining"][0] = principal
86
for i in range(1, payments + 1):
87
amor_table["Interest"][i] = amor_table["Remaining"][i - 1] * interest_rate
88
- amor_table["Principal"][i] = amor_table["Payment"][i] - amor_table["Interest"][i]
89
- amor_table["Remaining"][i] = amor_table["Remaining"][i - 1] - amor_table["Principal"][i]
+ amor_table["Principal"][i] = (
+ amor_table["Payment"][i] - amor_table["Interest"][i]
90
+ )
91
+ amor_table["Remaining"][i] = (
92
+ amor_table["Remaining"][i - 1] - amor_table["Principal"][i]
93
94
amor_table = amor_table.round(2)
95
amor_table = amor_table.abs()
96
0 commit comments