def test_numpy_piecewise_regression():
 p = Piecewise((1, (x < 0)), (0, True))
 assert (NumPyPrinter().doprint(p) == 'select([less(x, 0),True], [1,0], default=nan)')

def test_numpy_piecewise_regression ( ) : p = Piecewise ( ( 1 , ( x < 0 ) ) , ( 0 , True ) ) assert ( NumPyPrinter ( ) . doprint ( p ) == 'select([less(x, 0),True], [1,0], default=nan)' )
numpyprinter needs to print piecewise()s choicelist as a list to avoid breaking compatibility with numpy 1 .