概述
报错:
在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】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所遇到的程序开发问题。
如果您也喜欢它,动动您的小指点个赞吧