Book Image

NumPy: Beginner's Guide

By : Ivan Idris
Book Image

NumPy: Beginner's Guide

By: Ivan Idris

Overview of this book

Table of Contents (21 chapters)
NumPy Beginner's Guide Third Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
NumPy Functions' References
Index

Time for action – determining the internal rate of return


Let's reuse the cash flow series from the Time for action – calculating the net present value section. Call the irr() function with the cash flow series from the Time for action section:

print("Internal rate of return", np.irr([-100, 38, 48, 90, 17, 36]))

The internal rate of return:

Internal rate of return 0.373420226888

What just happened?

We calculated the internal rate of return from the cash flow series of the Time for action – calculating the net present value section. The value was given by the NumPy irr() function.