python中:TypeError: only size-1 arrays can be converted to Python scalars
这里写自定义目录标题Python中的math和numpy源程序修改后错误原因Python中的math和numpy错误描述:TypeError: only size-1 arrays can be converted to Python scalars源程序修改后错误原因numpy包中也含有sin(),pi需要使用numpy包中函数;这个mu在使用了numpy里的函数arange之后生成的是numpy的ndarray对象,也就是n维数组。 而类型为array的里面数据要处理需要使用numpy