this needs a docstring, see other numpy functions for the formatting