Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help with Question 1 In [3]: upro = pd.read_csv( 'UPRO.csv', index_col='Date', parse_dates=True) upro = upro.resample('1M').last()[['Adj close']].pct_change().multiply(100).dropna() upro.columns = ['R'] In [4]: ff = pd.read_csv
Please help with Question 1
In [3]: upro = pd.read_csv( 'UPRO.csv', index_col='Date', parse_dates=True) upro = upro.resample('1M').last()[['Adj close']].pct_change().multiply(100).dropna() upro.columns = ['R'] In [4]: ff = pd.read_csv 'F-F_Research_Data_Factors.csv', index_col=0, skiprows=3, nrows=12* (2020 - 1927 + 1) + 6 + 1 ) ff.index = pd.to_datetime(ff.index, format='%Y%m') + pd.offsets. MonthEnd (0) In [5]: df = upro.join(ff, how='inner') Question 1 (30 points, 2 public tests, 1 hidden test) Add a column to the data frame df that contains the monthly excess returns for UPRO. Label this excess returns column R-RF . In [5]: In [ ]: grader.check("q1")Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started