Return the range of the given array. If the array has 2 dimensions, return an array containing the minima and maxima of each of the rows.