【Python】ufunc 'subtract' did not contain a loop with signature matching types dtype

前端之家收集整理的这篇文章主要介绍了【Python】ufunc 'subtract' did not contain a loop with signature matching types dtype前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

报错:

在linux环境下,通过bash运行python文件,传递参数给函数,中途报错:

ufunc 'subtract' did not contain a loop with signature matching types dtype('

原因:

本地windows调试时候,参数是数字赋值,所以程序正常运行。

在linux环境下,传递参数给python文件,传入是字符串形式,所以无法正常加减运算。

dtype('

纠正:

maxv=int(args[3])   # 通过int()函数,将字符串强制转化为数字。

猜你在找的Python相关文章