Skip to content

Instantly share code, notes, and snippets.

@zachlim98
Created January 7, 2021 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachlim98/2d24dba53e5d4ffc2ef0b909ea60ce82 to your computer and use it in GitHub Desktop.
Save zachlim98/2d24dba53e5d4ffc2ef0b909ea60ce82 to your computer and use it in GitHub Desktop.
beta = profile.loc["beta"] #get beta of stock from stock profile
mktCap = quote.loc["marketCap"] #market cap of stock
totdebt = bs.loc["totalDebt",year] #total debt
sharesOut = quote.loc["sharesOutstanding"]
pg = 0.025 #perpetural growth
wacklist = []
for i,d in enumerate(["2015","2016","2017","2018","2019"]):
Rd = ins.loc["interestExpense", d]/totdebt*(1-(ins.loc["incomeTaxExpense",d]/ins.loc["incomeBeforeTax",d]))
Re = rfr + (beta*(10 - rfr))
wacc = float(((Rd)*(totdebt/(mktCap + totdebt)) + (Re)*(1-(totdebt/(mktCap + totdebt))))/100)
wacklist.append(Wacc)
wacc_stdd = np.std(wacklist)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment