From 08d4b58a6a38e60dc89308f192c3a0f4b9406df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Mon, 7 Jan 2019 17:55:35 +0100 Subject: [PATCH] NumPy --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ebfffb9..4b5afdc 100644 --- a/README.md +++ b/README.md @@ -1464,8 +1464,8 @@ NumPy ``` ```python -value = .min([axis]) -index = .argmin([axis]) +value = .min([axis]) +index = .argmin([axis]) ``` ```python @@ -1480,17 +1480,17 @@ index = .argmin([axis]) left = [[0.1], [0.6], [0.8]] # Shape: (3, 1) right = [ 0.1 , 0.6 , 0.8 ] # Shape: (3) ``` -1. If array shapes differ, left-pad the smaller shape with ones. +**1. If array shapes differ, left-pad the smaller shape with ones.** ```python left = [[0.1], [0.6], [0.8]] # Shape: (3, 1) right = [[0.1 , 0.6 , 0.8]] # Shape: (1, 3) <- ! ``` -2. If any dimensions differ in size, expand the ones that have size 1 by duplicating their elements. +**2. If any dimensions differ in size, expand the ones that have size 1 by duplicating their elements.** ```python left = [[0.1, 0.1, 0.1], [0.6, 0.6, 0.6], [0.8, 0.8, 0.8]] # Shape: (3, 3) <- ! right = [[0.1, 0.6, 0.8], [0.1, 0.6, 0.8], [0.1, 0.6, 0.8]] # Shape: (3, 3) <- ! ``` -3. If neither non-matching dimension has size 1, rise an error. +**3. If neither non-matching dimension has size 1, rise an error.** ### Example **For each point returns index of its nearest point: `[0.1, 0.6, 0.8] => [1, 2, 1]`.**