From 55e49ae736f3deda5314194088ec5bc24bb6b5bf Mon Sep 17 00:00:00 2001
From: Martin Mares <mj@ucw.cz>
Date: Sun, 23 Feb 2020 21:11:26 +0100
Subject: [PATCH] =?UTF-8?q?NumPy:=20P=C3=A1r=20oprav=20a=20drobnost=C3=AD?=
 =?UTF-8?q?=20nav=C3=ADc?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 02-numpy/02-numpy.tex |  8 +++++-
 02-numpy/notes        | 58 -------------------------------------------
 2 files changed, 7 insertions(+), 59 deletions(-)
 delete mode 100644 02-numpy/notes

diff --git a/02-numpy/02-numpy.tex b/02-numpy/02-numpy.tex
index ef8dace..2ed8454 100644
--- a/02-numpy/02-numpy.tex
+++ b/02-numpy/02-numpy.tex
@@ -50,7 +50,7 @@ a.shape  \cmt{(tvar pole)}
 \py{%
 a.size  \cmt{(celkový počet prvků)}
 }{%
-(2, 3)
+6
 }
 
 \py{%
@@ -301,6 +301,9 @@ array([[0, 3],\\
 ~~~~~~~[6, 9]])
 }
 
+Pozor, řezy odkazují do původního pole!
+Kopíruje se pomocí {\tt copy()}.
+
 \end{frame}
 
 % ----------------------------------------------------------------------
@@ -377,6 +380,9 @@ b
 array([ 0,  0,  0,  8,  0,  0, 12, 11,  9,  0])
 }
 
+Pozor, {\tt x == y} také vrací booleovský vektor.
+Pro porovnání celých vektorů se hodí {\tt np.equal()} nebo {\tt np.allclose()}.
+
 \end{frame}
 
 % ----------------------------------------------------------------------
diff --git a/02-numpy/notes b/02-numpy/notes
deleted file mode 100644
index 768f375..0000000
--- a/02-numpy/notes
+++ /dev/null
@@ -1,58 +0,0 @@
-https://numpy.org/devdocs/reference/
-
-np.array([], dtype=...)
-np.zeros((3, 4))
-np.ones((3, 4), dtype=...)
-zeros_like
-ones_like
-reshape
-arange
-linspace
-+ * @
-a.sum(), min, max
-a.sum(axis=0)
-a.shape  [pozor, není to funkce]
-slices  [pozor, nekopírují]
-a.copy()
-stretching
-
-
-
-
-matplotlib.pyplot.annotate(s, xy, *args, **kwargs)
-axis(\*args, \*\*kwargs)
-bar
-clf()
-figlegend
-
-fig = figure(figsize=...)
-grid
-hist ?
-savefig
-show
-
-subplot
-title
-xlabel
-ylabel
-xlim
-ylim
-x/yscale
-suptitle
-
-text
-
-tick_params
-
-xkcd
-
-
-
-random.seed
-randrange
-random
-uniform
-choice
-choices(list, k=10)
-shuffle(list)
-sample(list, k=10)
-- 
GitLab