How calculate IRR on dateframe(df). I have dateframe:
| ID | Amount_paid | Rate1 | Rate2 | Rate3 |
|---|---|---|---|---|
| 1 | -3000 | 78,40 | 78,40 | 2500 |
| 2 | -200 | 28,60 | 28,60 | 28,60 |
| 3 | -4000 | 635,90 | 635,90 | 3600 |
| 4 | -1000 | 635,90 | 635,90 | 3600 |
| 5 | -800 | 635,90 | 635,90 | 3600 |
df['IRR']=npf.irr(df.iloc[:,1:])
ValueError: Input must be a rank-1 array.
df.iloc[:,1:]selects all three columns:Rate1,Rate2andRate3. Butnumpy.irrrequires a single array as an input. It fails when you pass it three columns.Can you let me know what your desired output is?