Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed series warning #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions valinvest/fundamentals.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _get_financial_statements(self):
res = pd.concat([res, self._get_financial_statement(statement)])

res.loc[-1] = [self.ticker, "beta", "beta",
res["year"].max(), self.beta]
res["year"].max(numeric_only=True), self.beta]

dates = pd.DataFrame(range(2009, 2020), columns=['year'])
dates['key'] = 1
Expand Down Expand Up @@ -289,7 +289,7 @@ def roic_growth(self):

index_array = (
stmt[stmt["header"] == "net_income"].groupby(
["ticker", "year"]).sum().index
["ticker", "year"]).sum(numeric_only=True).index
)

res = pd.Series(np.where(value_array > 0.10, 1, 0), index=index_array)
Expand Down Expand Up @@ -334,7 +334,7 @@ def croic_growth(self):

index_array = (
stmt[stmt["header"] == "net_income"].groupby(
["ticker", "year"]).sum().index
["ticker", "year"]).sum(numeric_only=True).index
)

res = pd.Series(np.where(value_array > 0.10, 1, 0), index=index_array)
Expand Down Expand Up @@ -372,7 +372,7 @@ def ebitda_cover_growth(self):

index_array = (
stmt[stmt["header"] == "net_income"].groupby(
["ticker", "year"]).sum().index
["ticker", "year"]).sum(numeric_only=True).index
)

res = pd.Series(np.where(value_array > 6, 1, 0), index=index_array)
Expand Down Expand Up @@ -433,7 +433,7 @@ def debt_cost_growth(self):

index_array = (
stmt[stmt["header"] == "net_income"].groupby(
["ticker", "year"]).sum().index
["ticker", "year"]).sum(numeric_only=True).index
)

res = pd.Series(np.where(value_array < 0.05, 1, 0), index=index_array)
Expand Down Expand Up @@ -466,7 +466,7 @@ def _score(self, property, years=10):
if years > 10 or years <= 0:
raise ValueError("'years' should be between 0 and 10")

return property[-years:].sum() / years
return property[-years:].sum(numeric_only=True) / years

def eps_score(self, years=10):
"""Returns EPS score
Expand Down