From 94ac94ccb521a4f0380ea420b137f1a928ad5100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Tue, 29 Jan 2019 16:21:53 +0100 Subject: [PATCH] Format --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ebe5c33..ae3bac2 100644 --- a/README.md +++ b/README.md @@ -329,7 +329,7 @@ Format ``` ### General Options -```python +```bash {:<10} # ' ' {:>10} # ' ' {:^10} # ' ' @@ -1740,14 +1740,14 @@ import numpy as np ### Broadcasting **Broadcasting is a set of rules by which NumPy functions operate on arrays of different sizes and/or dimensions.** ```python -left = [[0.1], [0.6], [0.8]] # Shape: (3, 1) -right = [ 0.1 , 0.6 , 0.8 ] # Shape: (3) +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: ```python -left = [[0.1], [0.6], [0.8]] # Shape: (3, 1) -right = [[0.1 , 0.6 , 0.8]] # Shape: (1, 3) <- ! +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: