Exercise

# Initial project costs

The `numpy.npv(rate, values)`

function is very powerful because it allows you to pass in both positive and negative values.

For this exercise, you will calculate the net present value of two potential projects with different cash flows:

Year | Project 1 | Project 2 |
---|---|---|

1 | -$250 (initial investment) | -$250 (initial investment) |

2 | $100 cash flow | $300 cash flow |

3 | $200 cash flow | -$250 (net investment) |

4 | $300 cash flow | $300 cash flow |

5 | $400 cash flow | $300 cash flow |

In this example, project 1 only requires an initial investment of $250, generating a slowly increasing series of cash flows over the next 4 years.

Project 2, on the other hand, requires an initial investment of $250 and an additional investment of $250 in year 3. However, project 2 continues to generate larger cash flows.

Assuming both projects don't generate any more cash flows after the fifth year, which project would you decide to undertake? The best way to decide is by comparing the NPV of both projects.

Instructions

**100 XP**

- Create a
`numpy`

array of the cash flow values for project 1, assigning it to`cash_flows_1`

, and then do the same for project 2, assigning the values to`cash_flows_2`

. - Calculate the net present value of both projects 1 and 2 assuming a 3% inflation rate.