I am trying to get XIRR for each customer with multiple entries with dates and payments in float. I want to find XIRR for each customer by grouping them with Unique ID
Code I am trying
import pandas as pd
from pyxirr import xirr
result = df.groupby("ID")[["date","payment"]].apply(xirr)`
where df id my dataframe and ID, date and payment are my columns
I am getting error as InvalidPaymentsError: negative and positive payments are required