From dbf671238a53a224c42ffee107913b8718eab1d7 Mon Sep 17 00:00:00 2001 From: Cong Date: Wed, 12 Feb 2020 16:48:20 +0800 Subject: [PATCH] Correct the answer of question 9 --- source/exercises100.ktx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/exercises100.ktx b/source/exercises100.ktx index dd7fd99d..d4824607 100644 --- a/source/exercises100.ktx +++ b/source/exercises100.ktx @@ -85,8 +85,9 @@ Create a 3x3 matrix with values ranging from 0 to 8 (★☆☆) hint: reshape < a9 -nz = np.nonzero([1,2,0,0,4,0]) -print(nz) +Z = np.arange(9) +Z = Z.reshape(3, 3) +print(Z) < q10 Find indices of non-zero elements from [1,2,0,0,4,0] (★☆☆)