use Python to detect Simpson's paradox