This is another place that could use a clean-up.  I would simply write `func(val, axis)` in the line above.