From e2af1582e4ec4f667de170e3632726688042fb73 Mon Sep 17 00:00:00 2001 From: Haksell Date: Sat, 2 May 2020 12:21:09 +0200 Subject: [PATCH] threshold=np.nan doesn't work in most recent numpy versions --- source/exercises100.ktx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/exercises100.ktx b/source/exercises100.ktx index 1840c420..5f75b174 100644 --- a/source/exercises100.ktx +++ b/source/exercises100.ktx @@ -595,9 +595,12 @@ How to print all the values of an array? (★★☆) hint: np.set_printoptions < a49 -np.set_printoptions(threshold=np.nan) -Z = np.zeros((16,16)) -print(Z) +import sys + +a = np.arange(1001) +print(a) +with np.printoptions(threshold=sys.maxsize): + print(a) < q50 How to find the closest value (to a given scalar) in a vector? (★★☆)