What does “unsupported operand type(s) for -: 'int' and 'tuple'” means?

可紊 提交于 2019-12-06 14:08:23

integrate.quad() returns a tuple; deltahbarCO2 + 2*deltahbarH2O is an integer, you are trying to subtract the var tuple.

If you wanted just the integral y of the integrate.quad() result, use the first element of that tuple:

var = deltahbarCH4[0]

or use tuple assignment:

var, err = deltabarCH4

That error means that you are trying to use the subtraction operator - between a number and a tuple.

Based on the documentation, you probably want: var = deltahbarCH4[0], since that will give you the actual value of the integral, which you are computing with on a later line.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!