NumPy Array Statistics
Easy
Using NumPy, write a function array_stats(data) that takes a list of numbers and returns a tuple (mean, max, min, sum) of the array, all computed using NumPy functions.
Input
A list of numbers.
Output
A tuple (mean, max, min, sum).
Example
Input
[10, 20, 30, 40, 50]
Output
(30.0, 50, 10, 150)
Convert the list to a NumPy array with np.array(data), then use .mean(), .max(), .min(), .sum().
10 XP on solve
Back to lesson
Your Solution
Output
Click "Run" to execute your code...
⏳ Loading Python runtime (first run may take a few seconds)...
Log in to submit your solution and earn XP.