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

cash_flow and cash_flow attributes are missing for some yfinance.Ticker objects #1292

Closed
tjrix opened this issue Jan 13, 2023 · 6 comments
Closed

Comments

@tjrix
Copy link

tjrix commented Jan 13, 2023

For example, if you try TSX tickers "CP.TO" or "CNR.TO", the income statements (quarterly and annually) and balance sheet statements (quarterly and annually) DataFrames are populated in the class, but the cashflow statement attributes (quarterly and annually" both are blank; They are instantiated as string objects and are not DataFrames yet. Thanks!

@ValueRaider
Copy link
Collaborator

ValueRaider commented Jan 13, 2023

Can you post exact code that returns income statement? It should be failing with exception (#1291), so your report is interesting.

@tjrix
Copy link
Author

tjrix commented Jan 13, 2023

Sure, no problem. Here is the chunk that should do it. In my code it was spread over some other code bits but I think this extract covers it...

It fails on the last line as it can't seem to generate the cashflow statement for CP.TO (an others)

tick_str = 'CP.TO'
session = requests_cache.CachedSession('yfinance.cache')
yf_results = yf.Tickers(tick_str, session=session)
annual_cashflow_statement_df = yf_results.tickers['CP.TO'].cashflow

@tjrix
Copy link
Author

tjrix commented Jan 14, 2023

This morning I found a similar case, but different, for ticker = 'CCL-B.TO'. Income statement and Cashflow statement worked for that one, but now it is the balance sheet that fails to populate within the ticker object.

@ValueRaider
Copy link
Collaborator

Not seeing this error anywhere?

TypeError: string indices must be integers

Can you try with the fork/branch in #1297

@chongwuyang
Copy link

i have the same problem , some tickers return empty dataframe

t=yf.Ticker('GPN')
t.cashflow
Empty DataFrame
Columns: []
Index: []
t.quarterly_cashflow
Empty DataFrame
Columns: []
Index: []

@ValueRaider
Copy link
Collaborator

Can't reproduce bug with latest yfinance

@ValueRaider ValueRaider closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants