Moved Array Math, Creation slides around; Added time counters.
authorPuneeth Chaganti <punchagan@fossee.in>
Fri, 02 Oct 2009 22:44:57 +0530 (2009-10-02)
changeset 4 e5047bcbb608
parent 3 18a010e4caa0
child 5 838cedef5e9d
Moved Array Math, Creation slides around; Added time counters.
day2/session1.tex
--- a/day2/session1.tex	Fri Oct 02 18:02:38 2009 +0530
+++ b/day2/session1.tex	Fri Oct 02 22:44:57 2009 +0530
@@ -158,6 +158,7 @@
 # apply functions to array.
 >>> y = sin(x)
 \end{lstlisting}
+\inctime{5}
 \end{frame}
 
 \begin{frame}
@@ -196,16 +197,6 @@
 \inctime{10}
 \end{frame}
 
-\begin{frame}
-    {More Numpy}
-
-    \begin{itemize}
-        \item Multi-dimensional arrays
-        \item Random number generation
-    \end{itemize}
-
-\end{frame}
-
 \begin{frame}[fragile]
   \frametitle{Multi-dimensional arrays}
 \begin{lstlisting}
@@ -222,6 +213,38 @@
 
 \end{lstlisting}
 \end{frame}
+\begin{frame}[fragile]
+  \frametitle{Array math}
+  \begin{itemize}
+  \item Basic \alert{elementwise} math (given two arrays \typ{a, b}):
+      \typ{+, -, *, /, \%}
+  \item Inplace operators: \typ{a += b}, or \typ{add(a, b,
+      a)} etc.
+  \item Logical operations: \typ{equal (==)}, \typ{not\_equal (!=)},
+    \typ{less (<)}, \typ{greater (>)} etc.
+  \item Trig and other functions: \typ{sin(x), arcsin(x), sinh(x),
+      exp(x), sqrt(x)} etc.
+  \item \typ{sum(x, axis=0), product(x, axis=0)} 
+  \item \typ{dot(a, bp)}
+  \end{itemize}
+  \inctime{10}
+\end{frame}
+
+\subsection{Array Creation \& Slicing, Striding Arrays}
+\begin{frame}[fragile]
+  \frametitle{Array creation functions}
+  \begin{itemize}
+  \item \typ{array(object, dtype=None, \ldots)}
+  \item \typ{arange(start, stop=None, step=1 \ldots)}
+  \item \typ{linspace(start, stop, num=50, \ldots)}
+  \item \typ{ones(shape, dtype=None, \ldots)}
+  \item \typ{zeros(shape, dtype=float,\ldots)}
+  \item \typ{identity(n)}
+  \item \typ{empty(shape, dtype=float,\ldots)}
+  \item \typ{ones\_like(x)}, 
+  \item \typ{zeros\_like(x)}, \typ{empty\_like(x)}
+  \end{itemize}
+\end{frame}
 
 \begin{frame}[fragile]
   \frametitle{Slicing arrays}
@@ -237,6 +260,7 @@
 array([3, 6, 9])
 \end{lstlisting}
 \end{frame}
+
 \begin{frame}[fragile]
   \frametitle{Striding arrays}
 \begin{lstlisting}
@@ -248,41 +272,25 @@
 \end{lstlisting}
 \end{frame}
 
-\subsection{Array creation }
 \begin{frame}[fragile]
-  \frametitle{Array creation functions}
-  \begin{itemize}
-  \item \typ{array(object, dtype=None, \ldots)}
-  \item \typ{arange(start, stop=None, step=1 \ldots)}
-  \item \typ{linspace(start, stop, num=50, \ldots)}
-  \item \typ{ones(shape, dtype=None, \ldots)}
-  \item \typ{zeros(shape, dtype=float,\ldots)}
-  \item \typ{identity(n)}
-  \item \typ{empty(shape, dtype=float,\ldots)}
-  \item \typ{ones\_like(x)}, 
-  \item \typ{zeros\_like(x)}, \typ{empty\_like(x)}
-  \end{itemize}
+\frametitle{Random Numbers}
+\begin{lstlisting}
+>>> np.random.rand(3,2)
+array([[ 0.96276665,  0.77174861],
+       [ 0.35138557,  0.61462271],
+       [ 0.16789255,  0.43848811]])
+>>> np.random.randint(1,100)
+42
+\end{lstlisting}
+\inctime{15}
 \end{frame}
 
-\subsection{Array math}
 \begin{frame}[fragile]
-  \frametitle{Array math}
-  \begin{itemize}
-  \item Basic \alert{elementwise} math (given two arrays \typ{a, b}):
-      \typ{+, -, *, /, \%}
-  \item Inplace operators: \typ{a += b}, or \typ{add(a, b,
-      a)} etc.
-  \item Logical operations: \typ{equal (==)}, \typ{not\_equal (!=)},
-    \typ{less (<)}, \typ{greater (>)} etc.
-  \item Trig and other functions: \typ{sin(x), arcsin(x), sinh(x),
-      exp(x), sqrt(x)} etc.
-  \item \typ{sum(x, axis=0), product(x, axis=0)} 
-  \item \typ{dot(a, bp)}
-  \end{itemize}
+  \frametitle{Problem set 1.0}
+\inctime{15}
 \end{frame}
-
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \section{2D Plotting}
 \subsection{Getting Started}
 
@@ -314,7 +322,7 @@
 \end{itemize}
 \end{frame}
        
-\subsection{Playing with lines}
+\subsection{Plots - Lines, Labels and Legends}
 \begin{frame}[fragile]
   \frametitle{Basic plotting \ldots}
 \begin{lstlisting}
@@ -344,8 +352,6 @@
     
 \end{frame}
 
-\subsection{Handling Text}
-
 \begin{frame}[fragile]
   \frametitle{Legends and Annotation}
 \begin{lstlisting}
@@ -616,8 +622,9 @@
 polar(theta, r, color='#ee8d18', lw=3)
 # the radius of the grid labels
 setp(ax.thetagridlabels, y=1.075) 
-title(r"$\theta=4\pi r", fontsize=20)
+title(r'$\theta=4\pi r$', fontsize=20)
 \end{lstlisting}
+
   \end{block}
 \end{columns}
 \end{frame}