将Union对象转换为间隔列表

时间:2016-04-14 15:40:45

标签: python list union sympy

如何将Sympy中的Union对象转换为子间隔列表?

E.g。转换这个:

(-oo, a] U [b, oo)

到此:

[(-oo,a], [b,oo)]

1 个答案:

答案 0 :(得分:4)

SELECT EMP_ID, DateName(weekday, Cast(schedule.DATE AS date)), SUM(duration) as TotalHrs 
FROM pl00.DBO.schedule
where (schedule.DATE  = CONVERT(char(10), getdate()+2, 121) -- ?
and schedule.TYPE <> "Z")
group by EMP_ID, Cast(schedule.DATE AS date)
HAVING SUM(duration) > 6

注意:如果 b&lt; a ,那么间隔联合是( - ∞,∞)