diff --git a/exercises/02450Toolbox_Python/Scripts/ex2_1_2.py b/exercises/02450Toolbox_Python/Scripts/ex2_1_2.py new file mode 100644 index 0000000000000000000000000000000000000000..dea5b3f9d071dbfe5fc62042a0708269e31523c1 --- /dev/null +++ b/exercises/02450Toolbox_Python/Scripts/ex2_1_2.py @@ -0,0 +1,19 @@ +# exercise 2.1.1 +import numpy as np + +x = np.array([-0.68, -2.11, 2.39, 0.26, 1.46, 1.33, 1.03, -0.41, -0.33, 0.47]) + +# Compute values +mean_x = x.mean() +std_x = x.std(ddof=1) # ddof: Delta Degrees of freedom +median_x = np.median(x) +range_x = x.max() - x.min() + +# Display results +print("Vector:", x) +print("Mean:", mean_x) +print("Standard Deviation:", std_x) +print("Median:", median_x) +print("Range:", range_x) + +print("Ran Exercise 2.1.1") \ No newline at end of file