multiarray map (and python wrapper)