从雅虎下载公司市值

时间:2019-02-21 20:40:48

标签: python python-3.x yahoo-finance pandas-datareader

我已经看到可以使用此project从python从yahoo下载股票价格。我想知道是否还可以根据历史记录下载公司的市值?

我似乎找不到找到执行此操作的函数?

1 个答案:

答案 0 :(得分:1)

  

对于pandas_datareader版本0.7.0 + 47.g7522f75

pandas_datareader中的

data.get_quote_yaho将提供股票的大多数当前详细信息。对于市值,

from pandas_datareader import data
tickers = ['AAPL','AMZN','TSLA','GOOG']
data.get_quote_yahoo(tickers)['marketCap']

AAPL    964416176128
AMZN    928656588800
GOOG    869718360064
TSLA     45642039296
Name: marketCap, dtype: int64

它还具有以下详细信息:

0 language
1 region
2 quoteType
3 quoteSourceName
4 epsForward
5 currency
6 sharesOutstanding
7 bidSize
8 trailingPE
9 priceToBook
10 dividendDate
11 regularMarketChangePercent
12 market
13 fiftyDayAverageChange
14 forwardPE
15 regularMarketPrice
16 regularMarketTime
17 regularMarketChange
18 regularMarketOpen
19 regularMarketDayHigh
20 regularMarketDayLow
21 regularMarketVolume
22 bookValue
23 ask
24 regularMarketPreviousClose
25 preMarketChangePercent
26 regularMarketDayRange
27 twoHundredDayAverageChange
28 bid
29 fiftyTwoWeekLowChange
30 askSize
31 financialCurrency
32 twoHundredDayAverage
33 gmtOffSetMilliseconds
34 shortName
35 longName
36 preMarketChange
37 twoHundredDayAverageChangePercent
38 trailingAnnualDividendYield
39 exchangeDataDelayedBy
40 fiftyTwoWeekLow
41 fiftyTwoWeekHigh
42 averageDailyVolume3Month
43 fiftyDayAverage
44 exchangeTimezoneShortName
45 esgPopulated
46 marketState
47 marketCap
48 epsTrailingTwelveMonths
49 fullExchangeName
50 earningsTimestampStart
51 earningsTimestampEnd
52 trailingAnnualDividendRate
53 earningsTimestamp
54 fiftyTwoWeekLowChangePercent
55 fiftyTwoWeekHighChangePercent
56 averageDailyVolume10Day
57 exchange
58 priceHint
59 exchangeTimezoneName
60 preMarketTime
61 fiftyDayAverageChangePercent
62 fiftyTwoWeekRange
63 tradeable
64 fiftyTwoWeekHighChange
65 preMarketPrice
66 sourceInterval
67 messageBoardId
68 price