pandas logical and operator with and without brackets produces different results