0

Python Bitcoin

#Create an array with the initial investment as the first element (with a negative value), followed by the cost of 10 bitcoins per year -- multiply the values of the given array by 10 and accordingly add them to the list you created, placing them after the investment value. This is the correct result: 0.07297 import numpy as np import numpy_financial as npf #price for 2018-2021 bitcoin = [-500.000, 3869.47*10, 7188.46*10, 22203.31*10, 29391.78*10] print(npf.irr(bitcoin)) What is wrong hereß

6th Feb 2022, 4:17 PM
An Uni
5 Answers
+ 2
import numpy as np import numpy_financial as npf #price for 2018-2021 bitcoin = [3869.47, 7188.46, 22203.31, 29391.78] x=np.std(bitcoin) print(x) bitcoin = [-500000, 3869.47*10, 7188.46*10, 22203.31*10, 29391.78*10] print(npf.irr(bitcoin))
14th Jun 2022, 7:14 PM
SARIKA SODHI
SARIKA SODHI - avatar
0
The initial investment should be -500000 as the irr function goes like -Initial_Investment+(value1/(1+r)) + (value2/(1+r)^2)... And so on till last value of array such that the sum results in 0 as output in order to have the exact internal rate of return
8th Feb 2022, 4:05 AM
Mukesh Kumar
Mukesh Kumar - avatar
0
It's wrong: -500.000 You need: -500000 Point is not needed here.
3rd Jun 2022, 2:30 AM
Grigoriy Tashu
Grigoriy Tashu - avatar
0
Yes, it's work
25th Jul 2022, 11:03 PM
Diffalah Oualid