Fixed Income - Certicificate of Deposit (CD) - Compound Interest Schedule An interest-at-maturity CD earns interest at a compounding frequency, and pays principal plus all earned interest at maturity. Write a function, called CompoundInterestSchedule, that creates and returns a pandas DataFrame, where each row has: time (in years, an integer starting at 1), starting balance, interest earned, and ending balance, for an investment earning compoundedinterest. Use a for(or while) loop to create this table. The equation for theith year's ending balance is given by: Ei =Bi (1+r/f)f where: Ei is year i's ending balance Bi is year i's beginning balance (note: B1 is the amount of the initial investment (principal) r is the annual rate of interest (in decimal, e.g., 5% is .05) f is the number of times the interest rate compounds (times per year)   The interest earned for a given year is Ei - Bi   Note the term of the investment (in years) is not in the above equation; it is used to determine how many rows the table will have.

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter4: Analyzing And Charting Financial Data
Section: Chapter Questions
Problem 3RA
icon
Related questions
Question

Jupyter Notebook

Fixed Income - Certicificate of Deposit (CD) - Compound Interest Schedule

An interest-at-maturity CD earns interest at a compounding frequency, and pays principal plus all earned interest at maturity.

Write a function, called CompoundInterestSchedule, that creates and returns a pandas DataFrame, where each row has: time (in years, an integer starting at 1), starting balance, interest earned, and ending balance, for an investment earning compoundedinterest.

Use a for(or while) loop to create this table. The equation for theith year's ending balance is given by:

Ei =Bi (1+r/f)f

where:

Ei is year i's ending balance

Bis year i's beginning balance (note: B1 is the amount of the initial investment (principal)

r is the annual rate of interest (in decimal, e.g., 5% is .05)

f is the number of times the interest rate compounds (times per year)

 

The interest earned for a given year is Ei - Bi

 

Note the term of the investment (in years) is not in the above equation; it is used to determine how many rows the table will have.

 

Test your function by calling it, for example: (see image bellow)

b = 1000 # initial balance of $1, 000
t = 5 # 5-year investment
r = .05 # interest rate of 5%
f = 2 # semi-annual compounding
schedule = CompoundInterestSchedule(b, t, r, f)
print(schedule)
Transcribed Image Text:b = 1000 # initial balance of $1, 000 t = 5 # 5-year investment r = .05 # interest rate of 5% f = 2 # semi-annual compounding schedule = CompoundInterestSchedule(b, t, r, f) print(schedule)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole