在1.3版之前,此代码运行良好:
from sympy import Intersection;
from sympy import solveset;
from sympy import S; from sympy.abc import x;
from sympy.functions.elementary.miscellaneous import Min, Max;
print Intersection([solveset(p, x, S.Reals) for p in [((((x + 2.0000) * 3.0000)+18.000000) > 0.000), ((((x + 2.0000) * 3.0000)+18.000000) < 1.000)]])
我不知道如何使用新的Intersection
,请参见https://github.com/sympy/sympy/pull/16344
答案 0 :(得分:0)
找到了解决方案:我必须使用Intersection
-运算符将*
的参数解包:
print Intersection(*[solveset(p, x, S.Reals) for p in [((((x + 2.0000) * 3.0000)+18.000000) > 0.000), ((((x + 2.0000) * 3.0000)+18.000000) < 1.000)]])