【问题标题】:(python)Yahoo and pandas-datareader error: RemoteDataError: Unable to read URL(python)Yahoo 和 pandas-datareader 错误:RemoteDataError: Unable to read URL
【发布时间】:2022-08-17 18:14:06
【问题描述】:

我无法从 yahoo Finance 获取股票数据,即使我已经通过在终端上命令 pip install --upgrade pandaspip install --upgrade pandas-datareader 更新了 pandas 和 pandas-data reader。

import math
import pandas_datareader as web
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from keras.models import Sequential
from keras.layers import Dense, LSTM
import matplotlib.pyplot as plt

df = web.DataReader(\'APPL\', data_source=\'yahoo\', start=\'2012-01-01\', end=\'2022-08-17\')
df

但是我不断收到此错误消息:

RemoteDataError: Unable to read URL: https://finance.yahoo.com/quote/APPL/history?period1=1325390400&period2=1660795199&interval=1d&frequency=1d&filter=history

任何人都可以帮忙吗?

    标签: python pandas machine-learning pandas-datareader


    【解决方案1】:

    没有名为APPL 的股票。你可能想写AAPL

    df = web.DataReader('AAPL', data_source='yahoo', start='2012-01-01', end='2022-08-17')
    

    【讨论】:

      【解决方案2】:

      我认为您的股票代码或公司 ID 拼写错误。

      会是“AAPL”吗?

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-09-14
        • 1970-01-01
        • 2019-11-10
        • 1970-01-01
        • 2017-10-18
        • 2017-10-22
        • 2018-08-11
        • 1970-01-01
        相关资源
        最近更新 更多