``numpy.apply_along_axis`` or ``map`` here