xirr package
Submodules
xirr.math module
- xirr.math.cleanXirr(valuesPerDate: dict[datetime.date, float]) Optional[float] [source]
A “cleaned” version of the xirr which avoids returning a xirr for some extreme cases and ignores amounts which are almost 0.
- xirr.math.listsXirr(dates: list[datetime.date], values: list[float], whichXirr: typing.Callable[[dict[datetime.date, float]], typing.Optional[float]] = <function xirr>) Optional[float] [source]
A convenience function that takes two lists of dates and values rather than a combined dictionary.
Use whichXirr to select the actuall xirr function to use.
Anti-pattern: Using a simple dictionary comprehension would not work, e.g. xirr({d: v for d, v in zip(dates, values)}) Because this overwrites entries with identical dates.