Calculate median, percentiles, quantiles, covariance, and correlation matrices (corrcoef).
NumPy provides rich statistical tools for data science: `np.median` for robust center metrics, `np.percentile` for distribution thresholds, and `np.corrcoef` for Pearson correlation matrices.
Mean is sensitive to Elon Musk entering the bar (average wealth skyrockets). Median is the middle person in line, staying stable regardless of extreme outliers.
`np.corrcoef(x, y)` returns a 2x2 normalized covariance matrix where values range from -1.0 (inverse correlation) to +1.0 (perfect positive correlation).
corr = np.corrcoef(x, y)[0, 1]data.median() # AttributeError: 'numpy.ndarray' has no .median() methodnp.median(data)Unlike `.mean()`, `median` is only available as a top-level function `np.median(arr)`.
Solve the objective below using NumPy vectorized syntax
Create `arr = np.array([5, 1, 9, 3, 7])`, calculate its median with `np.median(arr)`, and print.
5.0