Skip to content

Commit

Permalink
Merge pull request #157 from mschaefer0815/main
Browse files Browse the repository at this point in the history
Update ratios_controller.py
  • Loading branch information
JerBouma authored Sep 21, 2024
2 parents b026b4a + bfe4386 commit e961ebb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions financetoolkit/ratios/ratios_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4910,7 +4910,7 @@ def get_earnings_per_share(
.sum()
.T,
dividends,
average_shares.T.rolling(trailing).sum().T,
average_shares, # Shares of current period
)
else:
dividends = (
Expand Down Expand Up @@ -4991,7 +4991,7 @@ def get_revenue_per_share(
if trailing:
revenue_per_share = valuation_model.get_revenue_per_share(
self._income_statement.loc[:, "Revenue", :].T.rolling(trailing).sum().T,
average_shares.T.rolling(trailing).sum().T,
average_shares, # Shares of current period, alternatively average_shares.T.rolling(trailing).mean().T
)
else:
revenue_per_share = valuation_model.get_revenue_per_share(
Expand Down Expand Up @@ -5373,7 +5373,7 @@ def get_interest_debt_per_share(
.T.rolling(trailing)
.sum()
.T,
average_shares.T.rolling(trailing).sum().T,
average_shares, # Shares of current period, alternatively average_shares.T.rolling(trailing).mean().T
)
else:
interest_debt_per_share = valuation_model.get_interest_debt_per_share(
Expand Down Expand Up @@ -5451,7 +5451,7 @@ def get_capex_per_share(
.T.rolling(trailing)
.sum()
.T,
average_shares.T.rolling(trailing).sum().T,
average_shares, # Shares of current period, alternatively average_shares.T.rolling(trailing).mean().T
)
else:
capex_per_share = valuation_model.get_capex_per_share(
Expand Down Expand Up @@ -5598,7 +5598,7 @@ def get_weighted_dividend_yield(
.T.rolling(trailing)
.sum()
.T,
average_shares.T.rolling(trailing).sum().T,
average_shares, # Shares of current period, alternatively average_shares.T.rolling(trailing).mean().T
share_prices,
)
else:
Expand Down Expand Up @@ -5837,7 +5837,8 @@ def get_market_cap(

if trailing:
market_cap = valuation_model.get_market_cap(
share_prices, average_shares.T.rolling(trailing).sum().T
share_prices,
average_shares, # Shares of current period, alternatively average_shares.T.rolling(trailing).mean().T
)
else:
market_cap = valuation_model.get_market_cap(share_prices, average_shares)
Expand Down

0 comments on commit e961ebb

Please sign in to comment.