成功解决ValueError: setting an array element with a sequence. The requested array has an...

2023-11-17

背景:
这个问题是在使用scipy和numpy处理数据时出现的
scipy的版本为1.9.1
numpy的版本为1.25.0
而scipy=1.9.1时,与其匹配的numpy版本为
[1.18.5, 1.25.0)
左闭右开

如果不匹配的话
在使用np.array将list转为array时会报错

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (16, 3) + inhomogeneous part.

此时,需要重新安装一个匹配的numpy就可以了。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

成功解决ValueError: setting an array element with a sequence. The requested array has an... 的相关文章

随机推荐