From 5ab7bfbdfa8bcc258ab7fed4675d2a4c2a641df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Tue, 29 Jan 2019 20:00:57 +0100 Subject: [PATCH] Numpy --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5a163be..947d65e 100644 --- a/README.md +++ b/README.md @@ -1325,9 +1325,7 @@ ValueError: malformed node or string import ast from ast import Num, BinOp, UnaryOp import operator as op -``` -```python legal_operators = {ast.Add: op.add, ast.Sub: op.sub, ast.Mult: op.mul, @@ -1718,15 +1716,17 @@ import numpy as np = np.random.randint(from_inclusive, to_exclusive, ) ``` +#### Shape is a tuple of dimension sizes: ```python -.shape = # Shape is a tuple of dimension sizes. - = .reshape() - = np.broadcast_to(, ) +.shape = + = .reshape() + = np.broadcast_to(, ) ``` +#### Axis is an index of dimension that gets collapsed: ```python - = .sum([]) # Axis is an index of dimension that gets collapsed. - = .argmin([]) # Returns index/es of smallest element/s. + = .sum() + = .argmin() ``` ### Indexing