无法理解错误消息(Python中的回归)

时间:2019-07-04 21:02:36

标签: python pandas quandl

我目前正在关注senddex的实用机器学习YouTube教程(顺便说一下,第3页)。我在尝试打印表格时遇到了一条我不明白的错误消息。以下是我的代码及其错误消息。

import pandas as pd
import quandl
import math

df = quandl.get('WIKI/GOOGL')
df = df[['Adj.Open', 'Adj.High', 'Adj.Low', 'Adj.Close', 'Adj.Volume',]]
df['HL_PCT'] = (df['Adj.High'] - df['Adj.Close'])/ df['Adj.Close'] * 
 100.0
df['PCT_change'] = (df['Adj.Close'] - df['Adj.Open'])/ df['Adj.Open'] * 
100.0

df = df[['Adj.Close', 'HL_PCT', 'PCT_change', 'Adj.Volume']]


forecastcol = 'Adj. Close'
df. fillna(-99999, inplace=True)

forecast_out = int (math.ceil (0.1 * len(df)))

df['label'] = df[forecast_col].shift(-forecast_out)

print(df.head())

Traceback (most recent call last): File "C:\Users\progr\AppData\Local\Programs\Python\Python37-32\regression.py", line 5, in <module> df = quandl.get('WIKI/GOOGL') File "C:\Users\progr\AppData\Local\Programs\Python\Python37-32\lib\site-packages\quandl\get.py", line 48, in get data = Dataset(dataset_args['code']).data(params=kwargs, handle_column_not_found=True) File "C:\Users\progr\AppData\Local\Programs\Python\Python37-32\lib\site-packages\quandl\model\dataset.py", line 47, in data return Data.all(**updated_options) File "C:\Users\progr\AppData\Local\Programs\Python\Python37-32\lib\site-packages\quandl\operations\list.py", line 15, in all r = Connection.request('get', path, **options) File "C:\Users\progr\AppData\Local\Programs\Python\Python37-32\lib\site-packages\quandl\connection.py", line 38, in request return cls.execute_request(http_verb, abs_url, **options) File "C:\Users\progr\AppData\Local\Programs\Python\Python37-32\lib\site-packages\quandl\connection.py", line 50, in execute_request cls.handle_api_error(response) File "C:\Users\progr\AppData\Local\Programs\Python\Python37-32\lib\site-packages\quandl\connection.py", line 114, in handle_api_error raise klass(message, resp.status_code, resp.text, resp.headers, code)

我希望输出是一个值表,其标头为“ Adj”。关闭”,“ HL_PCT”等。

0 个答案:

没有答案