TypeError: ufunc 'multiply' did not contain a loop with signature matching types dtype('S32')

来源:互联网 发布:哔哩哔哩软件下载 编辑:程序博客网 时间:2024/05/10 03:51

今天拿python写AdaBoost的时候碰到的,一看报错提示就知道是类型错误,后来参考了
http://hyry.dip.jp/tech/book/page/scipy/numpy_ndarray.html
得知S32就是 长度为32个字节的字符串类型,这下就好办了,发现问题是出在读取txt数据时没有转换类型,依旧保持着字符类型。

解决方案:
float()

2 0
原创粉丝点击