From 3580544f9efc85ef99c98b1013c435d734bcb46f Mon Sep 17 00:00:00 2001 From: Aleksey Zadoiniy Date: Wed, 31 Oct 2018 11:27:30 +0300 Subject: [PATCH] Exercise 22 corrected after #67 --- 100_Numpy_exercises.ipynb | 3 +-- 100_Numpy_exercises.md | 3 +-- 100_Numpy_exercises_with_hint.ipynb | 2 +- 100_Numpy_exercises_with_hint.md | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/100_Numpy_exercises.ipynb b/100_Numpy_exercises.ipynb index 7315491..dfb6fe7 100644 --- a/100_Numpy_exercises.ipynb +++ b/100_Numpy_exercises.ipynb @@ -435,8 +435,7 @@ "outputs": [], "source": [ "Z = np.random.random((5,5))\n", - "Zmax, Zmin = Z.max(), Z.min()\n", - "Z = (Z - Zmin)/(Zmax - Zmin)\n", + "Z = (Z - np.mean (Z)) / (np.std (Z))\n", "print(Z)" ] }, diff --git a/100_Numpy_exercises.md b/100_Numpy_exercises.md index 8b5e393..c6958c9 100644 --- a/100_Numpy_exercises.md +++ b/100_Numpy_exercises.md @@ -187,8 +187,7 @@ print(Z) ```python Z = np.random.random((5,5)) -Zmax, Zmin = Z.max(), Z.min() -Z = (Z - Zmin)/(Zmax - Zmin) +Z = (Z - np.mean (Z)) / (np.std (Z)) print(Z) ``` diff --git a/100_Numpy_exercises_with_hint.ipynb b/100_Numpy_exercises_with_hint.ipynb index 5e1a70f..631cbaf 100644 --- a/100_Numpy_exercises_with_hint.ipynb +++ b/100_Numpy_exercises_with_hint.ipynb @@ -387,7 +387,7 @@ "metadata": {}, "source": [ "#### 22. Normalize a 5x5 random matrix (★☆☆) \n", - "(**hint**: (x - min) / (max - min))" + "(**hint**: (x - mean) / std)" ] }, { diff --git a/100_Numpy_exercises_with_hint.md b/100_Numpy_exercises_with_hint.md index cba1f71..2b4e63a 100644 --- a/100_Numpy_exercises_with_hint.md +++ b/100_Numpy_exercises_with_hint.md @@ -145,7 +145,7 @@ np.nan - np.nan #### 22. Normalize a 5x5 random matrix (★☆☆) -(**hint**: (x - min) / (max - min)) +(**hint**: (x - mean) / std)