我把Pandas当作PD
dataset = pd.read_csv('C:\\Users\\Adminis....')
dataset.plot(x='tempmin', y='tempmax', style='o')
pit.show()
pit.figure(figsize=(15,10)) #these are working fine
pit.tight_layout()
seaborninstance.distplot(dataset['tempmax'])
pit.show()
but i am getting in trouble while using this
x = dataset['tempmin'].values.reshape(-1,-1)
y = dataset['tempmax'].values.reshape(-1,-1)
x = dataset['tempmin'].values.reshape(-1,-1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: can only specify one unknown dimension
我本来想用这个来训练我的算法,但是我被一个变量卡住了?
1条答案
按热度按时间yuvru6vn1#
在
reshape
函数中只能指定一个维度大小。我猜您想将 Dataframe 列转换为列向量以馈送到某个训练模块中,那么您需要将其整形为(-1,1)而不是(-1,-1),即