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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education