python 做数据归一化 MinMaxScaler 时报错

python中使用 MinMaxScaler 对数据做预处理

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

start = datetime.datetime(2011,1,1)
end = datetime.date.today()
df = web.DataReader("1211.HK", "yahoo", start, end)

plt.figure(figsize=(16,8))
plt.title('BYD close price',fontsize=18)
plt.plot(df['Close'])
plt.xlabel('Date',fontsize=18)
plt.ylabel('Close price HK($)',fontsize=18)
plt.show()

data = df.filter(['close'])
#convert dataframe to numpy array
dataset = data.values

trainning_data_len =math.ceil(len (dataset)*.8)
scaler = MinMaxScaler()
scaled_data = scaler.fit_transform(dataset)

当我打印 scaled_data 时报错,不清楚时什么原因,报错如下:

ValueError: Found array with 0 feature(s) (shape=(2698, 0)) while a minimum of 1 is required by MinMaxScaler.

麻烦帮忙解答一下,感谢