Hey Sencer, Thank you for making the time to make this video for everyone. I wanted to know, should we have taken the time to de-annualise the risk free rate to daily "risk free" returns instead of using the original annualised value quoted?
Hi Spencer, like mentioned in the other comment. On this video, almost all code blocks which is longer than the screen can't be displayed. Could you provide the missing code or upload the whole script on github? Many thanks for the videos! They are as always great. :)
Thanks Spencer. I tried the code and I am encountering a ValueError when Merging the dataframes: ValueError: You are trying to merge on object and datetime64[ns] columns. If you wish to proceed you should use pd.concat
@@SpencerPaoHere Hi Spencer, the error happens at this line of code: # Merge dataframes d['DATE'] = d['DATE'].astype(str) data = pd.merge(left = T_rate, right = d, left_on = 'DATE', right_on = 'DATE') data = data.rename(columns = {"DGS10": "10_Year_Rate"})
by formatting the d["Date"] to a string format, the error doesnt happen anymore. However if i leave it without the first line (like in the original code), the error happens.
Hey Sencer, Thank you for making the time to make this video for everyone. I wanted to know, should we have taken the time to de-annualise the risk free rate to daily "risk free" returns instead of using the original annualised value quoted?
thank you bro
how do you get your avg rate of the sp500?
Hi Spencer, like mentioned in the other comment. On this video, almost all code blocks which is longer than the screen can't be displayed. Could you provide the missing code or upload the whole script on github? Many thanks for the videos! They are as always great. :)
Code: github.com/SpencerPao/Quantitative_Strategies/tree/main/Capital%20Asset%20Pricing%20Model
Thanks Spencer. I tried the code and I am encountering a ValueError when Merging the dataframes:
ValueError: You are trying to merge on object and datetime64[ns] columns. If you wish to proceed you should use pd.concat
@@chh6316 Hmm. Which function?
Code might be outdated.
@@SpencerPaoHere Hi Spencer, the error happens at this line of code:
# Merge dataframes
d['DATE'] = d['DATE'].astype(str)
data = pd.merge(left = T_rate, right = d, left_on = 'DATE', right_on = 'DATE')
data = data.rename(columns = {"DGS10": "10_Year_Rate"})
by formatting the d["Date"] to a string format, the error doesnt happen anymore. However if i leave it without the first line (like in the original code), the error happens.
It doesn't work. It needs an upgrade too.
Thanks. But are you actually real ?
Well. What is real and what isn't real?
Cmon, you should be human enough to know 😏