使用Python包yfinance读取雅虎财经上的股票数据
安装yfinance
yfinance是一个使用简单但是功能强大的开源Python包,通过这个包我们可以获取在雅虎财经上列出来的包含历史数据的所有证券信息。除了通过GitHub上的源码安装外,建议使用传统的pip来安装。
python3 -m pip install yfinance --upgrade --no-cache-dir
导入yfinance
yfinance包有一个Ticker模块,可以通过该模块获取到相应证券的市场数据。以下抓取苹果公司(AAPL)的相关数据为例。
import yfinance as yf
aapl = yf.Ticker('AAPL')
print(aapl)
yfinance.Ticker object <AAPL>
获取股票所对应信息 - info
调用Ticker对象的info函数可以获取该股票的所有信息,返回一个dictionary结构数据,里面包含比如该公司所属sector,员工数,所在城市,和各种财务表现等。由于整个dictionary比较大,下面只选择打印了几个信息。
aapl_info = aapl.info
print('AAPL sector: ', aapl_info['sector'])
print('AAPL EBITA Margins: ', aapl_info['ebitdaMargins'])
print('AAPL Profit Margins: ', aapl_info['profitMargins'])
print('AAPL Gross Margins: ', aapl_info['grossMargins'])
print('AAPL Day High: ', aapl_info['dayHigh'])
AAPL sector: Technology
AAPL EBITA Margins: 0.32867
AAPL Profit Margins: 0.25882
AAPL Gross Margins: 0.41779
AAPL Day High: 177.725
获取股票历史数据 - history
调用history函数可以获取到该股票的历史数据。该函数有以下几个参数可供配置。
- period,表示获取多久的数据,有10种选择:1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max。
- interval,表示数据的精度,有13种选择:1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo。天以内的数据只能最多采集60天以内的,精度越高,能采集的数据天数更少,比如1m数据只能采集7天以内的。
- start,如果没有配置period,也可以使用start即数据开始时间和end即数据结束时间来定义应该获取多久的数据
- end,同上
- prepost,是否包含盘前和盘后价格,默认False不包含
- auto_adjust,是否按照美国线(英语:Open-High-Low-Close chart,OHLC chart)来调整,含开盘价、最高价、最低价、收盘价,默认True
- actions,是否包含分红和扩股信息,默认包含
# 获取AAPL所有的历史数据,并打印最开始5天的记录
aapl_history_max = aapl.history(period='max')
aapl_history_max.head()
Open | High | Low | Close | Volume | Dividends | Stock Splits | |
---|---|---|---|---|---|---|---|
Date | |||||||
1980-12-12 | 0.100453 | 0.100890 | 0.100453 | 0.100453 | 469033600 | 0.0 | 0.0 |
1980-12-15 | 0.095649 | 0.095649 | 0.095213 | 0.095213 | 175884800 | 0.0 | 0.0 |
1980-12-16 | 0.088661 | 0.088661 | 0.088224 | 0.088224 | 105728000 | 0.0 | 0.0 |
1980-12-17 | 0.090408 | 0.090845 | 0.090408 | 0.090408 | 86441600 | 0.0 | 0.0 |
1980-12-18 | 0.093029 | 0.093466 | 0.093029 | 0.093029 | 73449600 | 0.0 | 0.0 |
# 获取AAPL从2021年12月1日到2021年12月15日精度为2分钟的历史数据,并打印最开始的5条记录。
aapl_history_1m = aapl.history(start="2021-12-01", end="2021-12-15", interval="2m")
aapl_history_1m.head()
Open | High | Low | Close | Volume | Dividends | Stock Splits | |
---|---|---|---|---|---|---|---|
Datetime | |||||||
2021-12-01 09:30:00-05:00 | 166.839996 | 167.095901 | 166.559998 | 166.845001 | 7578140 | 0 | 0 |
2021-12-01 09:32:00-05:00 | 166.845001 | 166.990005 | 166.429993 | 166.429993 | 1212147 | 0 | 0 |
2021-12-01 09:34:00-05:00 | 166.242203 | 166.500000 | 166.139999 | 166.259995 | 1304022 | 0 | 0 |
2021-12-01 09:36:00-05:00 | 166.250000 | 166.800003 | 166.089996 | 166.468796 | 1390514 | 0 | 0 |
2021-12-01 09:38:00-05:00 | 167.000000 | 167.419907 | 167.000000 | 167.399994 | 1572092 | 0 | 0 |
获取股票的分红和扩股数据 - actions
其实在获取历史数据的时候我们就可以直接获取到股票的分红和扩股数据,但是并不是每一条历史数据上都有分红或者扩股,使用actions函数可以直接获取到该信息。结合上面的历史数据信息我们可以看到AAPL在1980年发行以后到1987年5月11日才开始第一次分红,同年的6月16日开始第一次扩股。
aapl_actions = aapl.actions
aapl_actions.head()
Dividends | Stock Splits | |
---|---|---|
Date | ||
1987-05-11 | 0.000536 | 0.0 |
1987-06-16 | 0.000000 | 2.0 |
1987-08-10 | 0.000536 | 0.0 |
1987-11-17 | 0.000714 | 0.0 |
1988-02-12 | 0.000714 | 0.0 |
获取股票的分红数据 - dividends
actions函数的返回结果同时记录了分红和扩股信息,如果只想看分红信息,可以直接使用dividends。
aapl_dividends = aapl.dividends
aapl_dividends.head()
Date
1987-05-11 0.000536
1987-08-10 0.000536
1987-11-17 0.000714
1988-02-12 0.000714
1988-05-16 0.000714
Name: Dividends, dtype: float64
获取股票的分红数据 - splits
actions函数的返回结果同时记录了分红和扩股信息,如果只想看扩股信息,可以直接使用splits。
aapl_splits = aapl.splits
aapl_splits.head()
Date
1987-06-16 2.0
2000-06-21 2.0
2005-02-28 2.0
2014-06-09 7.0
2020-08-31 4.0
Name: Stock Splits, dtype: float64
获取重要持股人信息 - major_holders
可以看到AAPL主要由机构持股。
aapl_major_holders = aapl.major_holders
aapl_major_holders
0 | 1 | |
---|---|---|
0 | 0.07% | % of Shares Held by All Insider |
1 | 58.81% | % of Shares Held by Institutions |
2 | 58.86% | % of Float Held by Institutions |
3 | 4959 | Number of Institutions Holding Shares |
获取重要机构持股人信息 - institutional_holders
aapl_institutional_holders = aapl.institutional_holders
aapl_institutional_holders.head()
Holder | Shares | Date Reported | % Out | Value | |
---|---|---|---|---|---|
0 | Vanguard Group, Inc. (The) | 1266332667 | 2021-09-29 | 0.0772 | 179186072380 |
1 | Blackrock Inc. | 1026223983 | 2021-09-29 | 0.0626 | 145210693594 |
2 | Berkshire Hathaway, Inc | 887135554 | 2021-09-29 | 0.0541 | 125529680891 |
3 | State Street Corporation | 622163541 | 2021-09-29 | 0.0379 | 88036141051 |
4 | FMR, LLC | 350617759 | 2021-09-29 | 0.0214 | 49612412898 |
获取共同基金持股人信息 - mutualfund_holders
aapl_mutualfund_holders = aapl.mutualfund_holders
aapl_mutualfund_holders.head()
Holder | Shares | Date Reported | % Out | Value | |
---|---|---|---|---|---|
0 | Vanguard Total Stock Market Index Fund | 443797660 | 2021-09-29 | 0.0271 | 62797368890 |
1 | Vanguard 500 Index Fund | 329777051 | 2021-09-29 | 0.0201 | 46663452716 |
2 | SPDR S&P 500 ETF Trust | 166047529 | 2021-09-29 | 0.0101 | 23495725353 |
3 | Fidelity 500 Index Fund | 152173622 | 2021-10-30 | 0.0093 | 22795608575 |
4 | Invesco ETF Tr-Invesco QQQ Tr, Series 1 ETF | 145254426 | 2021-10-30 | 0.0089 | 21759113014 |
获取详细财务信息
当季财年信息 - calendar
aapl_calendar = aapl.calendar
aapl_calendar
0 | 1 | |
---|---|---|
Earnings Date | 2022-01-25 21:00:00 | 2022-01-31 21:00:00 |
Earnings Average | 1.88 | 1.88 |
Earnings Low | 1.75 | 1.75 |
Earnings High | 1.97 | 1.97 |
Revenue Average | 118137000000 | 118137000000 |
Revenue Low | 111806000000 | 111806000000 |
Revenue High | 121303000000 | 121303000000 |
年度营业收入和税后收益 - earnings
只显示最近四次财务统计期
aapl_earnings = aapl.earnings
aapl_earnings
Revenue | Earnings | |
---|---|---|
Year | ||
2018 | 265595000000 | 59531000000 |
2019 | 260174000000 | 55256000000 |
2020 | 274515000000 | 57411000000 |
2021 | 365817000000 | 94680000000 |
季度营业收入和税后收益 - quarterly_earnings
只显示最近四次财务统计期
aapl_quarterly_earnings = aapl.quarterly_earnings
aapl_quarterly_earnings
Revenue | Earnings | |
---|---|---|
Quarter | ||
4Q2020 | 111439000000 | 28755000000 |
1Q2021 | 89584000000 | 23630000000 |
2Q2021 | 81434000000 | 21744000000 |
3Q2021 | 83360000000 | 20551000000 |
年度详细财报 - financials
只显示最近四个财务统计期
aapl_financials = aapl.financials
aapl_financials
2021-09-25 | 2020-09-26 | 2019-09-28 | 2018-09-29 | |
---|---|---|---|---|
Research Development | 21914000000.0 | 18752000000.0 | 16217000000.0 | 14236000000.0 |
Effect Of Accounting Charges | None | None | None | None |
Income Before Tax | 109207000000.0 | 67091000000.0 | 65737000000.0 | 72903000000.0 |
Minority Interest | None | None | None | None |
Net Income | 94680000000.0 | 57411000000.0 | 55256000000.0 | 59531000000.0 |
Selling General Administrative | 21973000000.0 | 19916000000.0 | 18245000000.0 | 16705000000.0 |
Gross Profit | 152836000000.0 | 104956000000.0 | 98392000000.0 | 101839000000.0 |
Ebit | 108949000000.0 | 66288000000.0 | 63930000000.0 | 70898000000.0 |
Operating Income | 108949000000.0 | 66288000000.0 | 63930000000.0 | 70898000000.0 |
Other Operating Expenses | None | None | None | None |
Interest Expense | -2645000000.0 | -2873000000.0 | -3576000000.0 | -3240000000.0 |
Extraordinary Items | None | None | None | None |
Non Recurring | None | None | None | None |
Other Items | None | None | None | None |
Income Tax Expense | 14527000000.0 | 9680000000.0 | 10481000000.0 | 13372000000.0 |
Total Revenue | 365817000000.0 | 274515000000.0 | 260174000000.0 | 265595000000.0 |
Total Operating Expenses | 256868000000.0 | 208227000000.0 | 196244000000.0 | 194697000000.0 |
Cost Of Revenue | 212981000000.0 | 169559000000.0 | 161782000000.0 | 163756000000.0 |
Total Other Income Expense Net | 258000000.0 | 803000000.0 | 1807000000.0 | 2005000000.0 |
Discontinued Operations | None | None | None | None |
Net Income From Continuing Ops | 94680000000.0 | 57411000000.0 | 55256000000.0 | 59531000000.0 |
Net Income Applicable To Common Shares | 94680000000.0 | 57411000000.0 | 55256000000.0 | 59531000000.0 |
季度详细财报 - quarterly_financials
只显示最近四个财务统计期
aapl_quarterly_financials = aapl.quarterly_financials
aapl_quarterly_financials
2021-09-25 | 2021-06-26 | 2021-03-27 | 2020-12-26 | |
---|---|---|---|---|
Research Development | 5772000000.0 | 5717000000.0 | 5262000000.0 | 5163000000.0 |
Effect Of Accounting Charges | None | None | None | None |
Income Before Tax | 23248000000.0 | 24369000000.0 | 28011000000.0 | 33579000000.0 |
Minority Interest | None | None | None | None |
Net Income | 20551000000.0 | 21744000000.0 | 23630000000.0 | 28755000000.0 |
Selling General Administrative | 5616000000.0 | 5412000000.0 | 5314000000.0 | 5631000000.0 |
Gross Profit | 35174000000.0 | 35255000000.0 | 38079000000.0 | 44328000000.0 |
Ebit | 23786000000.0 | 24126000000.0 | 27503000000.0 | 33534000000.0 |
Operating Income | 23786000000.0 | 24126000000.0 | 27503000000.0 | 33534000000.0 |
Other Operating Expenses | None | None | None | None |
Interest Expense | -672000000.0 | -665000000.0 | -670000000.0 | -638000000.0 |
Extraordinary Items | None | None | None | None |
Non Recurring | None | None | None | None |
Other Items | None | None | None | None |
Income Tax Expense | 2697000000.0 | 2625000000.0 | 4381000000.0 | 4824000000.0 |
Total Revenue | 83360000000.0 | 81434000000.0 | 89584000000.0 | 111439000000.0 |
Total Operating Expenses | 59574000000.0 | 57308000000.0 | 62081000000.0 | 77905000000.0 |
Cost Of Revenue | 48186000000.0 | 46179000000.0 | 51505000000.0 | 67111000000.0 |
Total Other Income Expense Net | -538000000.0 | 243000000.0 | 508000000.0 | 45000000.0 |
Discontinued Operations | None | None | None | None |
Net Income From Continuing Ops | 20551000000.0 | 21744000000.0 | 23630000000.0 | 28755000000.0 |
Net Income Applicable To Common Shares | 20551000000.0 | 21744000000.0 | 23630000000.0 | 28755000000.0 |
年度资产负债表 - balance_sheet
只显示最近四个财务统计期
aapl_balance_sheet = aapl.balance_sheet
aapl_balance_sheet
2021-09-25 | 2020-09-26 | 2019-09-28 | 2018-09-29 | |
---|---|---|---|---|
Total Liab | 2.879120e+11 | 2.585490e+11 | 2.480280e+11 | 2.585780e+11 |
Total Stockholder Equity | 6.309000e+10 | 6.533900e+10 | 9.048800e+10 | 1.071470e+11 |
Other Current Liab | 5.357700e+10 | 4.786700e+10 | 4.324200e+10 | 3.929300e+10 |
Total Assets | 3.510020e+11 | 3.238880e+11 | 3.385160e+11 | 3.657250e+11 |
Common Stock | 5.736500e+10 | 5.077900e+10 | 4.517400e+10 | 4.020100e+10 |
Other Current Assets | 1.411100e+10 | 1.126400e+10 | 1.235200e+10 | 1.208700e+10 |
Retained Earnings | 5.562000e+09 | 1.496600e+10 | 4.589800e+10 | 7.040000e+10 |
Other Liab | 4.305000e+10 | 4.610800e+10 | 5.050300e+10 | 4.891400e+10 |
Treasury Stock | 1.630000e+08 | -4.060000e+08 | -5.840000e+08 | -3.454000e+09 |
Other Assets | 3.876200e+10 | 3.395200e+10 | 3.297800e+10 | 2.228300e+10 |
Cash | 3.494000e+10 | 3.801600e+10 | 4.884400e+10 | 2.591300e+10 |
Total Current Liabilities | 1.254810e+11 | 1.053920e+11 | 1.057180e+11 | 1.159290e+11 |
Short Long Term Debt | 9.613000e+09 | 8.773000e+09 | 1.026000e+10 | 8.784000e+09 |
Other Stockholder Equity | 1.630000e+08 | -4.060000e+08 | -5.840000e+08 | -3.454000e+09 |
Property Plant Equipment | 4.952700e+10 | 4.533600e+10 | 3.737800e+10 | 4.130400e+10 |
Total Current Assets | 1.348360e+11 | 1.437130e+11 | 1.628190e+11 | 1.313390e+11 |
Long Term Investments | 1.278770e+11 | 1.008870e+11 | 1.053410e+11 | 1.707990e+11 |
Net Tangible Assets | 6.309000e+10 | 6.533900e+10 | 9.048800e+10 | 1.071470e+11 |
Short Term Investments | 2.769900e+10 | 5.292700e+10 | 5.171300e+10 | 4.038800e+10 |
Net Receivables | 5.150600e+10 | 3.744500e+10 | 4.580400e+10 | 4.899500e+10 |
Long Term Debt | 1.091060e+11 | 9.866700e+10 | 9.180700e+10 | 9.373500e+10 |
Inventory | 6.580000e+09 | 4.061000e+09 | 4.106000e+09 | 3.956000e+09 |
Accounts Payable | 5.476300e+10 | 4.229600e+10 | 4.623600e+10 | 5.588800e+10 |
季度资产负债表 - quarterly_balance_sheet
只显示最近四个财务统计期
aapl_quarterly_balance_sheet = aapl.quarterly_balance_sheet
aapl_quarterly_balance_sheet
2021-09-25 | 2021-06-26 | 2021-03-27 | 2020-12-26 | |
---|---|---|---|---|
Total Liab | 2.879120e+11 | 2.655600e+11 | 2.679800e+11 | 2.878300e+11 |
Total Stockholder Equity | 6.309000e+10 | 6.428000e+10 | 6.917800e+10 | 6.622400e+10 |
Other Current Liab | 5.357700e+10 | 5.130600e+10 | 5.325500e+10 | 5.589900e+10 |
Total Assets | 3.510020e+11 | 3.298400e+11 | 3.371580e+11 | 3.540540e+11 |
Common Stock | 5.736500e+10 | 5.498900e+10 | 5.420300e+10 | 5.174400e+10 |
Other Current Assets | 1.411100e+10 | 1.364100e+10 | 1.337600e+10 | 1.368700e+10 |
Retained Earnings | 5.562000e+09 | 9.233000e+09 | 1.526100e+10 | 1.430100e+10 |
Other Liab | 4.305000e+10 | 3.835400e+10 | 3.985300e+10 | 4.304200e+10 |
Treasury Stock | 1.630000e+08 | 5.800000e+07 | -2.860000e+08 | 1.790000e+08 |
Other Assets | 3.876200e+10 | 4.485400e+10 | 4.333900e+10 | 4.327000e+10 |
Cash | 3.494000e+10 | 3.405000e+10 | 3.846600e+10 | 3.601000e+10 |
Total Current Liabilities | 1.254810e+11 | 1.077540e+11 | 1.063850e+11 | 1.325070e+11 |
Short Long Term Debt | 9.613000e+09 | 8.039000e+09 | 8.003000e+09 | 7.762000e+09 |
Other Stockholder Equity | 1.630000e+08 | 5.800000e+07 | -2.860000e+08 | 1.790000e+08 |
Property Plant Equipment | 4.952700e+10 | 3.861500e+10 | 3.781500e+10 | 3.793300e+10 |
Total Current Assets | 1.348360e+11 | 1.144230e+11 | 1.214650e+11 | 1.541060e+11 |
Long Term Investments | 1.278770e+11 | 1.319480e+11 | 1.345390e+11 | 1.187450e+11 |
Net Tangible Assets | 6.309000e+10 | 6.428000e+10 | 6.917800e+10 | 6.622400e+10 |
Short Term Investments | 2.769900e+10 | 2.764600e+10 | 3.136800e+10 | 4.081600e+10 |
Net Receivables | 5.150600e+10 | 3.390800e+10 | 3.303600e+10 | 5.862000e+10 |
Long Term Debt | 1.091060e+11 | 1.057520e+11 | 1.086420e+11 | 9.928100e+10 |
Inventory | 6.580000e+09 | 5.178000e+09 | 5.219000e+09 | 4.973000e+09 |
Accounts Payable | 5.476300e+10 | 4.040900e+10 | 4.012700e+10 | 6.384600e+10 |
年度现金流 - cashflow
只显示最近四个财务统计期
aapl_cashflow = aapl.cashflow
aapl_cashflow
2021-09-25 | 2020-09-26 | 2019-09-28 | 2018-09-29 | |
---|---|---|---|---|
Investments | -2.819000e+09 | 5.335000e+09 | 5.809300e+10 | 3.084500e+10 |
Change To Liabilities | 1.400200e+10 | -1.981000e+09 | -2.548000e+09 | 9.172000e+09 |
Total Cashflows From Investing Activities | -1.454500e+10 | -4.289000e+09 | 4.589600e+10 | 1.606600e+10 |
Net Borrowings | 1.266500e+10 | 2.499000e+09 | -7.819000e+09 | 4.320000e+08 |
Total Cash From Financing Activities | -9.335300e+10 | -8.682000e+10 | -9.097600e+10 | -8.787600e+10 |
Change To Operating Activities | -6.146000e+09 | 8.810000e+08 | -8.960000e+08 | 3.001600e+10 |
Issuance Of Stock | 1.105000e+09 | 8.800000e+08 | 7.810000e+08 | 6.690000e+08 |
Net Income | 9.468000e+10 | 5.741100e+10 | 5.525600e+10 | 5.953100e+10 |
Change In Cash | -3.860000e+09 | -1.043500e+10 | 2.431100e+10 | 5.624000e+09 |
Repurchase Of Stock | -9.252700e+10 | -7.599200e+10 | -6.971400e+10 | -7.526500e+10 |
Total Cash From Operating Activities | 1.040380e+11 | 8.067400e+10 | 6.939100e+10 | 7.743400e+10 |
Depreciation | 1.128400e+10 | 1.105600e+10 | 1.254700e+10 | 1.090300e+10 |
Other Cashflows From Investing Activities | -6.080000e+08 | -7.910000e+08 | -1.078000e+09 | -7.450000e+08 |
Dividends Paid | -1.446700e+10 | -1.408100e+10 | -1.411900e+10 | -1.371200e+10 |
Change To Inventory | -2.642000e+09 | -1.270000e+08 | -2.890000e+08 | 8.280000e+08 |
Change To Account Receivables | -1.012500e+10 | 6.917000e+09 | 2.450000e+08 | -5.322000e+09 |
Other Cashflows From Financing Activities | -1.290000e+08 | -1.260000e+08 | -1.050000e+08 | -1.050000e+08 |
Change To Netincome | 2.985000e+09 | 6.517000e+09 | 5.076000e+09 | -2.769400e+10 |
Capital Expenditures | -1.108500e+10 | -7.309000e+09 | -1.049500e+10 | -1.331300e+10 |
季度现金流 - quarterly_cashflow
只显示最近四个财务统计期
aapl_quarterly_cashflow = aapl.quarterly_cashflow
aapl_quarterly_cashflow
2021-09-25 | 2021-06-26 | 2021-03-27 | 2020-12-26 | |
---|---|---|---|---|
Investments | 4.608000e+09 | 5.747000e+09 | -7.895000e+09 | -5.279000e+09 |
Change To Liabilities | 1.405000e+10 | 3.070000e+08 | -2.336600e+10 | 2.301100e+10 |
Total Cashflows From Investing Activities | 8.350000e+08 | 3.572000e+09 | -1.036800e+10 | -8.584000e+09 |
Net Borrowings | 3.220000e+09 | 3.220000e+09 | 1.042300e+10 | -9.780000e+08 |
Total Cash From Financing Activities | -2.038200e+10 | -2.939600e+10 | -1.132600e+10 | -3.224900e+10 |
Change To Operating Activities | -5.602000e+09 | -6.048000e+09 | 1.126500e+10 | -5.761000e+09 |
Issuance Of Stock | 5.440000e+08 | 5.440000e+08 | 5.610000e+08 | 5.610000e+08 |
Net Income | 2.055100e+10 | 2.174400e+10 | 2.363000e+10 | 2.875500e+10 |
Change In Cash | 6.530000e+08 | -4.730000e+09 | 2.287000e+09 | -2.070000e+09 |
Repurchase Of Stock | -2.044900e+10 | -2.559500e+10 | -1.884700e+10 | -2.763600e+10 |
Total Cash From Operating Activities | 2.020000e+10 | 2.109400e+10 | 2.398100e+10 | 3.876300e+10 |
Depreciation | 2.989000e+09 | 2.832000e+09 | 2.797000e+09 | 2.666000e+09 |
Other Cashflows From Investing Activities | -5.300000e+08 | -7.800000e+07 | -2.040000e+08 | 2.040000e+08 |
Dividends Paid | -3.640000e+09 | -3.767000e+09 | -3.447000e+09 | -3.613000e+09 |
Change To Inventory | -1.429000e+09 | 1.300000e+07 | -2.760000e+08 | -9.500000e+08 |
Change To Account Receivables | -8.809000e+09 | 1.031000e+09 | 8.598000e+09 | -1.094500e+10 |
Other Cashflows From Financing Activities | -5.700000e+07 | -3.400000e+07 | -1.600000e+07 | -2.200000e+07 |
Change To Netincome | -1.550000e+09 | 1.215000e+09 | 1.333000e+09 | 1.987000e+09 |
Capital Expenditures | -3.223000e+09 | -2.093000e+09 | -2.269000e+09 | -3.500000e+09 |
其他信息
证券的ISIN号 - isin
ISIN表征国际证券识别码(英文:International Securities Identification Number,缩写:ISIN),辨别各种证券,是独一无二的编码。相同公司可能在多地上市,不同的证券交易市场会给与不同的股票代码,但是它的ISIN都是一样的。
aapl_isin = aapl.isin
aapl_isin
'US0378331005'
大机构的推荐信息 - recommendations
通过该函数可以获取各大机构在不同时期对该股票做的推荐信息,以下显示最近5个推荐记录。
aapl_recommendations = aapl.recommendations
aapl_recommendations.tail()
Firm | To Grade | From Grade | Action | |
---|---|---|---|---|
Date | ||||
2021-10-19 12:55:08 | DA Davidson | Buy | main | |
2021-10-27 13:11:01 | Morgan Stanley | Overweight | main | |
2021-10-29 10:56:50 | Oppenheimer | Outperform | main | |
2021-10-29 11:16:45 | Barclays | Equal-Weight | main | |
2021-10-29 11:41:38 | Morgan Stanley | Overweight | main |
后续期权到期时间 - options
以下显示最近5个期权到期时间
aapl_options = aapl.options
aapl.options[:5]
('2021-12-17', '2021-12-23', '2021-12-31', '2022-01-07', '2022-01-14')
相关新闻 - news
以下打印最近的一条新闻
aapl_news = aapl.news
aapl_news[0]
{'uuid': 'e6b5cca0-ce6d-35bf-9d41-b9d2723aa129',
'title': 'Biden Team Mulls New Clampdown on China’s Largest Chipmaker',
'publisher': 'Bloomberg',
'link': 'https://finance.yahoo.com/news/biden-team-considers-clampdown-china-231703320.html',
'providerPublishTime': 1639556151,
'type': 'STORY'}
股票分析预测信息 - analysis
可以获取当季,下一季度,下一财年等的分析预测信息,以下打印当季分析信息。
aapl_analysis = aapl.analysis
aapl_analysis.iloc[0]
Max Age 1
End Date 2021-12-31 00:00:00
Growth 0.119
Earnings Estimate Avg 1.880
Earnings Estimate Low 1.750
Earnings Estimate High 1.970
Earnings Estimate Year Ago Eps 1.680
Earnings Estimate Number Of Analysts 25.000
Earnings Estimate Growth 0.119
Revenue Estimate Avg 118137000000.000
Revenue Estimate Low 111806000000.000
Revenue Estimate High 121303000000.000
Revenue Estimate Number Of Analysts 22.000
Revenue Estimate Year Ago Revenue NaN
Revenue Estimate Growth NaN
Eps Trend Current 1.880
Eps Trend 7Days Ago 1.880
Eps Trend 30Days Ago 1.880
Eps Trend 60Days Ago 1.870
Eps Trend 90Days Ago 1.870
Eps Revisions Up Last7Days 1.000
Eps Revisions Up Last30Days 2.000
Eps Revisions Down Last30Days 0.000
Eps Revisions Down Last90Days NaN
Name: 0Q, dtype: object
可持续金融信息 - sustainability
可持续金融用来衡量企业追求环境目标,尤其是促进能源转型的金融法规,标准,规范和产品。
aapl.sustainability
Value | |
---|---|
2021-9 | |
palmOil | False |
controversialWeapons | False |
gambling | False |
socialScore | 7.99 |
nuclear | False |
furLeather | False |
alcoholic | False |
gmo | False |
catholic | False |
socialPercentile | None |
peerCount | 53 |
governanceScore | 8.64 |
environmentPercentile | None |
animalTesting | False |
tobacco | False |
totalEsg | 16.92 |
highestControversy | 3 |
esgPerformance | UNDER_PERF |
coal | False |
pesticides | False |
adult | False |
percentile | 13.68 |
peerGroup | Technology Hardware |
smallArms | False |
environmentScore | 0.29 |
governancePercentile | None |
militaryContract | False |