- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以我对市场之间的冗余标签名称有点问题。例如在使用以下代码获取数据时:
from pandas_datareader import data as pdr
from datetime import datetime
data = pdr.get_data_yahoo(['AC'], start=datetime(2020,1,6), end=datetime(2020,2,6))
NYSE:AC
(Associated Capitol Group Incorporated) 或
TSE:AC
(加航)?
最佳答案
我的理解是默认没有点和 extension name
来自美国市场。股票代码的扩展名是指美国以外的市场。这里有些例子。
AC.TO : Toronto
AC.PA : Paris
AC.MX : Mexico
AC.VI : Vienna
FPI1.BE : Berlin
F7TB.MU : Munich
longName
的
ticker
.
from datetime import datetime
import pandas_datareader.data as web
tickers = ['AC', 'AC.TO']
for ticker in tickers:
print('\n---------------------------------------------------------------\n')
data = web.get_data_yahoo([ticker], start=datetime(2020, 1, 6), end=datetime(2020, 2, 6))
df = web.get_quote_yahoo([ticker])
print(df[['longName', 'exchange', 'fullExchangeName', 'currency', 'quoteType', ]].T)
print()
print(data)
---------------------------------------------------------------
AC
longName Associated Capital Group, Inc.
exchange NYQ
fullExchangeName NYSE
currency USD
quoteType EQUITY
Attributes High Low Open Close Volume Adj Close
Symbols AC AC AC AC AC AC
Date
2020-01-06 39.790001 38.490002 38.490002 39.790001 3300 39.790001
2020-01-07 39.669998 38.590000 39.540001 39.160000 6200 39.160000
2020-01-08 39.790001 38.560001 38.889999 39.790001 6400 39.790001
2020-01-09 39.830002 39.750000 39.830002 39.750000 1800 39.750000
2020-01-10 39.520000 39.099998 39.520000 39.500000 5100 39.500000
2020-01-13 42.759998 39.250000 39.250000 42.759998 23000 42.759998
2020-01-14 47.779999 43.029999 43.160000 47.770000 13000 47.770000
2020-01-15 48.501999 47.049999 48.299999 48.419998 21400 48.419998
2020-01-16 52.820000 48.134998 48.160000 50.410000 10200 50.410000
2020-01-17 52.595001 50.160000 51.200001 51.080002 21400 51.080002
2020-01-21 65.459999 50.549999 50.709999 63.580002 42700 63.580002
2020-01-22 64.900002 56.000000 64.900002 57.220001 30700 57.220001
2020-01-23 57.480000 46.959999 57.480000 47.340000 26100 47.340000
2020-01-24 47.779999 42.299999 47.340000 42.349998 30000 42.349998
2020-01-27 48.540001 42.500000 42.500000 43.759998 28100 43.759998
2020-01-28 45.000000 43.040001 43.349998 43.880001 11700 43.880001
2020-01-29 43.689999 41.099998 43.689999 41.459999 15200 41.459999
2020-01-30 43.700001 41.730000 42.110001 42.790001 21900 42.790001
2020-01-31 42.730000 41.189999 42.299999 41.770000 20300 41.770000
2020-02-03 43.410000 42.020000 42.320000 42.279999 10900 42.279999
2020-02-04 43.299999 41.799999 42.490002 41.799999 16300 41.799999
2020-02-05 44.299999 41.730000 42.160000 43.889999 15200 43.889999
2020-02-06 45.430000 43.590000 43.937000 43.720001 19700 43.720001
2020-02-07 44.158001 41.290001 43.700001 41.290001 12600 41.290001
---------------------------------------------------------------
AC.TO
longName Air Canada
exchange TOR
fullExchangeName Toronto
currency CAD
quoteType EQUITY
Attributes High Low Open Close Volume Adj Close
Symbols AC.TO AC.TO AC.TO AC.TO AC.TO AC.TO
Date
2020-01-06 47.820000 47.110001 47.610001 47.299999 1134902 47.299999
2020-01-07 48.270000 47.200001 47.299999 48.240002 863739 48.240002
2020-01-08 49.279999 47.750000 47.750000 49.040001 1193122 49.040001
2020-01-09 50.389999 49.070000 49.119999 49.599998 1388006 49.599998
2020-01-10 51.014999 49.200001 49.590000 50.900002 1443019 50.900002
2020-01-13 52.180000 50.470001 50.849998 52.090000 1388026 52.090000
2020-01-14 52.709999 51.490002 52.029999 52.009998 1352906 52.009998
2020-01-15 52.459999 51.340000 51.930000 51.540001 1108539 51.540001
2020-01-16 52.220001 51.560001 51.700001 51.790001 930670 51.790001
2020-01-17 51.520000 50.160000 50.480000 51.080002 1767395 51.080002
2020-01-20 51.410000 50.660000 50.820000 51.150002 310712 51.150002
2020-01-21 50.610001 47.680000 50.500000 48.840000 3095071 48.840000
2020-01-22 49.680000 48.639999 49.299999 48.680000 1282190 48.680000
2020-01-23 49.000000 47.009998 48.459999 48.419998 2001993 48.419998
2020-01-24 48.580002 45.770000 48.450001 47.180000 2416449 47.180000
2020-01-27 45.529999 43.400002 43.410000 44.740002 2709248 44.740002
2020-01-28 45.770000 44.689999 45.119999 45.099998 2257306 45.099998
2020-01-29 45.959999 44.709999 45.279999 45.599998 1916354 45.599998
2020-01-30 45.200001 44.180000 45.099998 44.930000 1586113 44.930000
2020-01-31 45.139999 44.154999 44.630001 44.330002 1529131 44.330002
2020-02-03 45.180000 44.119999 44.369999 44.779999 1499613 44.779999
2020-02-04 47.250000 45.520000 45.590000 46.509998 1812547 46.509998
2020-02-05 48.060001 46.400002 47.250000 46.700001 1971011 46.700001
2020-02-06 47.130001 46.330002 47.000000 46.349998 1373740 46.349998
2020-02-07 46.250000 45.040001 46.250000 45.459999 1316269 45.459999
关于pandas-datareader - 使用python中的yahoo和pandas_datareader从不同市场获取市场数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60255760/
我正在尝试学习 Pandas 并想加载一些股票数据。我正在学习一门类(class),该类(class)建议我加载 pandas.io.data,但这不起作用,因为 io.data 已折旧。所以我决定改
我在 Ubuntu 16.04 中使用 Python 3.6。 从这个非常简单的程序: import pandas_datareader.data as web import datetime amz
这个问题在这里已经有了答案: "TypeError: string indices must be integers" when getting data of a stock from Yahoo
我正在尝试使用pandas_datareader.data从雅虎获取股票数据,但我不断收到丢失的数据部分。这是我编码的内容。我现在想做的就是返回开始日期和结束日期之间的所有数据 import pand
我正在用 python 创建一个证券交易所监控器,并且在使用 pandas_datareader 模块时遇到了问题。代码中原来的模块是pandas.io.data,由于pandas不再支持这个模块,所
我尝试通过以下代码从 google finance 获取数据: import pandas_datareader.data as wb import datetime as dt start = dt
在下面的绘图中,x 轴上未显示日期,如何显示日期时间戳 import numpy as np import pandas as pd import matplotlib.pyplot as plt
我在 pandas_datareader 上工作正常,然后今天我从下面的链接中安装了两个雅虎财经,试图解决另一个问题。 No data fetched Web.DataReader Panda pip
我刚刚安装了pandas_datareader使用 pip install pandas-datareader成功运行。 现在我正在尝试将它用于教程,当我尝试导入时出现此错误。 import
我正在尝试使用 this SO question 中指定的 pandas-datareader 获取股市历史记录。 . 我已经安装了 pandas-datareader:conda install -
我在虚拟环境中工作。我可以在没有任何错误的情况下导入和使用 Pandas ,但是当我尝试 import pandas_datareader import pandas as pd import num
这里是一个非常简单的问题,我无法找到阅读文档的答案(以下是摘录): import pandas_datareader.data as web # pandas 0.19.x and later
我是一名优秀的程序员,十分优秀!