选定列的标准化或归一化
**from sklearn.preprocessing import StandardScaler
sc = StandardScaler()
X_train[:,5:7] = sc.fit_transform(X_train[:,5:7])**
在这里,我想选择第5、6和9列。
有没有办法在此处选择第9列?
**from sklearn.preprocessing import StandardScaler
sc = StandardScaler()
X_train[:,5:7] = sc.fit_transform(X_train[:,5:7])**
Here I want to select 5th, 6th and 9th columns.
Is there a way to select the 9th column here??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了选择第五,第6和9列,您可以使用
.iloc
。注意列索引从0开始。因此,5,6的索引和9列的索引为4,5和8。In order to select 5th,6th and 9th columns, you can use
.iloc
. Note the column index starts from 0. So, the indices of 5,6, and 9th columns are 4,5 and 8.