[f(np.atleast_2d(a), np.atleast_2d(b)) for a, b in zip(np.broadcast_to(A, B
    .shape), B)]
[f(np.atleast_2d(a), np.atleast_2d(b)) for a, b in zip(np.broadcast_to(B, B
    .shape), B)]
python combining two logics of map()