0
Who can solve this project of Python Finance (Bitcoin) ???
In this project we will analyze Bitcoin prices, calculate the investment values, and analyze return rates. This project will involve multiple steps, with each step requiring a number of tasks to accomplish. We will start with easy tasks using static data, and progress to more advanced tasks that use real data we will obtain from the web. By the end of the project, we will be able to fetch Bitcoin’s real price, and analyze and create charts based on its historic values. Let's get started! The given code includes an array that identifies Bitcoin's price as of January 1 of each year between 2018-2021. Create a program to calculate and output the standard deviation of the price values.
9 odpowiedzi
+ 6
Niloufar Kashanian ,
to get useful help from the community, we need to see your attempt first. without having seen your code, it is difficult to find out where the issue is.
=> please put your code in playground and link it here
thanks!
+ 4
Lothar
import numpy as np
import numpy_financial as npf
#price for 2018-2021
bitcoin = [3869.47, 7188.46, 22203.31, 29391.78]
+ 2
🤔🤔
+ 2
import numpy as np
import numpy_financial as npf
#price for 2018-2021
bitcoin = [3869.47, 7188.46, 22203.31, 29391.78]
res = np.std(bitcoin )
print (res)
+ 2
import numpy as np
import numpy_financial as npf
#price for 2018-2021
bitcoin = [3869.47, 7188.46, 22203.31, 29391.78]
#initial investment $500k
myarray = [-500000]
# 10 bitcoin per year
for i in bitcoin:
myarray.append(i*10)
#the result
print(npf.irr(myarray))
+ 1
The solution is practically given to you in the highlighted box:
"Use the np.std() function with the array as an argument to calculate the standard deviation."
One more line will complete the code.
0
You can't just come up with a bitcoin price, You need to have some code that grabs it from an updating web source. Look into beautifulsoup library. You can pull direct prices from any bitcoin price watcher.
0
چه کار میخوای بکنی من بلدم بگو تا حل کنم
- 1
Niloufar Kashanian check your private messages, the solution is there. good luck :-) happy coding