python implementation of Microsoft Excel's XNPV and XIRR