Skip to content
Advertisement

yfinance specific financials for multiple companies

I want to get net income and research development for the current year from multiple companies. At present, ticker.financials from yfinance library gives me the full table for 4 years and for multiple metrics.

I am checking below the keys for financials and there are only by years.

JavaScript
JavaScript

For example,

JavaScript

gives me this

enter image description here

I want to create a ticker group like

JavaScript

For these companies I need the net income and research and development for 2021-06-30.

How is this possible with yfinance?

Advertisement

Answer

Since the format in which the company’s financial information is obtained is a data frame, the latest closing date is combined into an empty data frame. After merging, update the column names in the ticker list. The following is a part of the dataframe after the retrieval. With the obtained data, we extract the necessary subjects for each.

JavaScript

Research Development & Income

JavaScript
AAPL(2021-09-25) MSFT(2021-06-30) IBM(2020-12-31) GOOG(2020-12-31) ORCL(2021-05-31)
Research Development 2.1914e+10 2.0716e+10 6.333e+09 2.7573e+10 6.527e+09
Net Income 9.468e+10 6.1271e+10 5.59e+09 4.0269e+10 1.3746e+10
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement