def find_best_step(err_vals):
if np.all(np.isnan(err_vals)):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>return np.nanargmin(err_vals)<EOL>
Returns the index of the lowest of the passed values. Catches nans etc.