Skip to content

Commit

Permalink
修改 python3.x pca 语法错误
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangzhonglian committed Jun 11, 2018
1 parent d5379f8 commit a8024d7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/py3.x/ML/13.PCA/pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
def loadDataSet(fileName, delim='\t'):
fr = open(fileName)
stringArr = [line.strip().split(delim) for line in fr.readlines()]
datArr = [list(map(float, line) for line in stringArr)]
datArr = [list(map(float, line)) for line in stringArr]
#注意这里和python2的区别,需要在map函数外加一个list(),否则显示结果为 map at 0x3fed1d0
return mat(datArr)

Expand Down
Empty file.

0 comments on commit a8024d7

Please sign in to comment.