AttributeError:模块“ numpy”没有属性“ DataReader”

时间:2020-03-27 10:28:31

标签: python pandas numpy

导入库

import math
import pandas_datareader as web    
import numpy as web    
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    
plt.style.use('fivethirtyeight')    

获取股票报价

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

显示数据

df

AttributeError跟踪(最近一次呼叫最近) 在()中 ----> 1 df = web.DataReader('AAPL',data_source ='yahoo',start ='2012-01-01',end ='2019-12-17') 2#显示数据 3 df

AttributeError:模块'numpy'没有属性'DataReader'

enter image description here

1 个答案:

答案 0 :(得分:0)

您正在覆盖web

尝试:

import pandas_datareader as web    
import numpy as np