diff --git a/100_Numpy_exercises.ipynb b/100_Numpy_exercises.ipynb index 7315491..67e6a4d 100644 --- a/100_Numpy_exercises.ipynb +++ b/100_Numpy_exercises.ipynb @@ -339,6 +339,7 @@ "print(np.nan == np.nan)\n", "print(np.inf > np.nan)\n", "print(np.nan - np.nan)\n", + "print(np.nan in set([np.nan]))\n" "print(0.3 == 3 * 0.1)" ] }, @@ -435,8 +436,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..14ae2c5 100644 --- a/100_Numpy_exercises.md +++ b/100_Numpy_exercises.md @@ -146,6 +146,7 @@ print(0 * np.nan) print(np.nan == np.nan) print(np.inf > np.nan) print(np.nan - np.nan) +print(np.nan in set([np.nan])) print(0.3 == 3 * 0.1) ``` @@ -187,8 +188,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_no_solution.ipynb b/100_Numpy_exercises_no_solution.ipynb index d38bd4c..13fccbe 100644 --- a/100_Numpy_exercises_no_solution.ipynb +++ b/100_Numpy_exercises_no_solution.ipynb @@ -284,6 +284,7 @@ "np.nan == np.nan\n", "np.inf > np.nan\n", "np.nan - np.nan\n", + "np.nan in set([np.nan])\n", "0.3 == 3 * 0.1\n", "```" ] diff --git a/100_Numpy_exercises_no_solution.md b/100_Numpy_exercises_no_solution.md index 6e10456..44b3fbe 100644 --- a/100_Numpy_exercises_no_solution.md +++ b/100_Numpy_exercises_no_solution.md @@ -82,6 +82,7 @@ free to open an issue at np.nan == np.nan np.inf > np.nan np.nan - np.nan +np.nan in set([np.nan]) 0.3 == 3 * 0.1 ``` diff --git a/100_Numpy_exercises_with_hint.ipynb b/100_Numpy_exercises_with_hint.ipynb index 5e1a70f..6361ffd 100644 --- a/100_Numpy_exercises_with_hint.ipynb +++ b/100_Numpy_exercises_with_hint.ipynb @@ -301,6 +301,7 @@ "np.nan == np.nan\n", "np.inf > np.nan\n", "np.nan - np.nan\n", + "np.nan in set([np.nan])\n" "0.3 == 3 * 0.1\n", "```" ] @@ -387,7 +388,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..43aaccb 100644 --- a/100_Numpy_exercises_with_hint.md +++ b/100_Numpy_exercises_with_hint.md @@ -116,6 +116,7 @@ free to open an issue at np.nan == np.nan np.inf > np.nan np.nan - np.nan +np.nan in set([np.nan]) 0.3 == 3 * 0.1 ``` @@ -145,7 +146,7 @@ np.nan - np.nan #### 22. Normalize a 5x5 random matrix (★☆☆) -(**hint**: (x - min) / (max - min)) +(**hint**: (x - mean) / std)