How do you calculate the mean and median of a Numpy array?
Asked in the Round 1 - Panelist 2 stage. Numpy basics.
Implement calculate_mean_median(arr), where arr is a one-dimensional, non-empty NumPy array of finite numeric values. Return a tuple (mean, median) containing Python floating-point results. For an even-length array, the median is the average of the two middle values after sorting.
Example: np.array([1, 3, 2, 4]) returns (2.5, 2.5).
def calculate_mean_median(arr):