一、TypeError
1、TypeError: only size-1 arrays can be converted to Python scalars
math.log()不能对矩阵进行直接操作,只处理数值。当math与numpy同时存在时,默认调用的log()为math.log()。
改:1)调用numpy.log()
2)遍历,处理数值
二、空格、缩进问题
1、IndentationError:unindent does not match any outer indentation level