Home / Expert Answers / Computer Science / write-code-in-python-nbsp-import-pandas-as-pd-import-pandas-datareader-as-web-import-matplotlib-pyp-pa826

(Solved): Write code in python  import pandas as pd import pandas_datareader as web import matplotlib.pyp ...



Write code in python 

import pandas as pd
import pandas_datareader as web
import matplotlib.pyplot as plt
\#In this exam we will compare the risk/r
import pandas as pd import pandas_datareader as web import matplotlib.pyplot as plt \#In this exam we will compare the risk/returns of one of the best performing "traditional" assets - TESLA stock versus Bitcoin \#To do this we will need to: \# 1. REMOTELY download Tesla historical prices from exchange of your choice from Jan 1st, 2019 to Jan 2nd, 2022 ( If yahoo doesn't work you can use source Stooq with ticker TSLA. US) \# 2. Normalize returns to day 0 . I.e. value for Jan 1st, 2019 will be 1.00 \# 3. Calculate the variance(standard deviation) for Tesla on the NORMALIZED data(from step 2) \# 4. Create two columns for price plus and minus two standard deviations. \# 5. Load data from BTC-USD. csv \# 6. Perform steps 2-4 for BTC data \# 7. Plot them together on the same graph \# 8. Add horizontal line on graph at 0


We have an Answer from Expert

View Expert Answer

Expert Answer


import pandas as pd import pandas_datareader as web import matplotlib.pyplot as plt tesla = web.DataReader('TSLA', 'yahoo', '2019-01-01', '2022-01-02'
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe