python之featVec[:axis]|extend|append

features = [1,2,3,4]
retDataSet=[]
reducedFeatVec=features[:0]    
print(reducedFeatVec)
reducedFeatVec.extend(features[1:])   #从1开始往 后加进来
print(reducedFeatVec)
retDataSet.append(reducedFeatVec) #变为向量
print(retDataSet)

 

posted @ 2018-05-15 19:31  jude_python  阅读(862)  评论(0编辑  收藏  举报