mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-30 05:52:23 +00:00
fix bug where mkt_cap or div_yield would show error if not found in yfinance info
This commit is contained in:
@@ -138,6 +138,8 @@ def property_weighting(
|
||||
return
|
||||
for stock in list_of_stocks:
|
||||
stock_prop = yf.Ticker(stock).info[property_type]
|
||||
if stock_prop is None:
|
||||
stock_prop = 0
|
||||
prop[stock] = stock_prop
|
||||
prop_sum += stock_prop
|
||||
for k, v in prop.items():
|
||||
|
||||
Reference in New Issue
Block a user