summaryrefslogtreecommitdiff
path: root/day2/session2.tex
diff options
context:
space:
mode:
authorPuneeth Chaganti2009-10-09 12:26:47 +0530
committerPuneeth Chaganti2009-10-09 12:26:47 +0530
commit03a14523d14cdda1926239da170de23e3e2336db (patch)
tree909155dc41e9c6dbb0417fe18d082d9f7ec3ace5 /day2/session2.tex
parent851b06f1ef9c53f64515b02a5f0bc9e584329c8d (diff)
downloadworkshops-more-scipy-03a14523d14cdda1926239da170de23e3e2336db.tar.gz
workshops-more-scipy-03a14523d14cdda1926239da170de23e3e2336db.tar.bz2
workshops-more-scipy-03a14523d14cdda1926239da170de23e3e2336db.zip
Minor edits to Copies and Views.
Diffstat (limited to 'day2/session2.tex')
-rw-r--r--day2/session2.tex8
1 files changed, 4 insertions, 4 deletions
diff --git a/day2/session2.tex b/day2/session2.tex
index 3f0184d..f93b02f 100644
--- a/day2/session2.tex
+++ b/day2/session2.tex
@@ -150,7 +150,7 @@
\includegraphics[height=0.7in, interpolate=true]{data/broadcast_scalar}
\end{columns}
\begin{itemize}
- \item Allows functions to take inputs not of the same shape
+ \item Allows functions to take inputs that are not of the same shape
\item 2 rules -
\begin{enumerate}
\item 1 is (repeatedly) prepended to shapes of smaller arrays
@@ -177,8 +177,9 @@
\begin{frame}[fragile]
\frametitle{Copies \& Views}
Try it!
+ \vspace{-0.1in}
\begin{lstlisting}
- >>> a = np.array([[1,2,3],[4,5,6]])
+ >>> a = np.arange(1,9); a.shape=3,3
>>> b = a
>>> b is a
>>> b[0,0]=0; print a
@@ -195,9 +196,8 @@
\begin{frame}[fragile]
\frametitle{Copies \& Views}
Try it!
+ \vspace{-0.1in}
\begin{lstlisting}
- >>> a = np.arange(1,9)
- >>> a.shape=3,3
>>> b = a[0,1:3]
>>> c = a[0::2,0::2]
>>> a.flags.owndata