Я получаю эту ошибку. Если. iloc
является ответом, как я видел на другом вопросе, то как мне использовать .iloc
или X = X.values
здесь?
Ошибка:
raise KeyError("{} not found in axis".format(labels[mask]))
KeyError: '[3.0 3.0 1.0 ... 3.0 0.0 3.0] not found in axis'
Код:
forecast_price = 'price'
df.fillna(1, inplace=True)
outcome = int(math.ceil(0.01*(len(df))))
df['label'] = df[forecast_price].shift(-outcome)
df.dropna(inplace=True)
X = np.array(df.drop(df['label'],1))
y = np.array(df['label'])
x = preprocessing.scale(X)
df.dropna(inplace=True)
y = np.array(df['label'])