From the course: Advanced Python in Excel for Finance: A Hands-On Approach
Unlock the full course today
Join today to access over 24,600 courses taught by industry experts.
Basic financial calculations
From the course: Advanced Python in Excel for Finance: A Hands-On Approach
Basic financial calculations
- [Instructor] We will focus on the mathematical backbone of finance to guide you through the process of calculating fundamental financial metrics and ratios directly within Python. We'll start with calculating the NPV, the annuity, the internal rate of return of an investment. Understanding these calculations is vital for assessing investment viability. So once you have your Excel, you can just come home here. We just have to activate our Python environment. And of course we can start by writing the function once that calculates the NPV, which takes as input the rates and the cash flows. And of course we have to define the periods. Periods. And periods, of course we can just give the NumPy arrange method, and we give the length of the cash flows. Next we want to return the submission. The NumPy also has the sum method, so we don't have to go outside that. Power the periods, the number of periods of course. Now we can give an example of cash flows and then try computing the NPV. And…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.