From d805f82a51cf85c2ff20dd1c3bb2052dd7a22173 Mon Sep 17 00:00:00 2001 From: Puneeth Chaganti Date: Thu, 21 Jan 2010 17:49:05 +0530 Subject: Fixed few more errors found during REC workshop. --- day1/session4.tex | 77 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/day1/session4.tex b/day1/session4.tex index 257fd54..9195ff6 100644 --- a/day1/session4.tex +++ b/day1/session4.tex @@ -134,15 +134,15 @@ \begin{frame}[fragile] \frametitle{Matrices: Initializing} \begin{lstlisting} -In []: c = array([[1,1,2], - [2,4,1], - [-1,3,7]]) +In [23]: c = array([[11,12,13], + [21,22,23], + [31,32,33]]) In []: c Out[]: -array([[1,1,2], - [2,4,1], - [-1,3,7]]) +array([[11, 12, 13], + [21, 22, 23], + [31, 32, 33]]) \end{lstlisting} \end{frame} @@ -174,16 +174,16 @@ Also available \alert{\typ{zeros, zeros_like, empty, empty_like}} \begin{lstlisting} In []: c Out[]: -array([[1,1,2], - [2,4,1], - [-1,3,7]]) +array([[11, 12, 13], + [21, 22, 23], + [31, 32, 33]]) In []: c[1][2] -Out[]: 1 +Out[]: 23 In []: c[1,2] -Out[]: 1 +Out[]: 23 In []: c[1] -Out[]: array([2, 4, 1]) +Out[]: array([21, 22, 23]) \end{lstlisting} \end{frame} @@ -191,19 +191,19 @@ Out[]: array([2, 4, 1]) \frametitle{Changing elements} \begin{small} \begin{lstlisting} -In []: c[1,1] = -2 +In []: c[1,1] = -22 In []: c Out[]: -array([[ 1, 1, 2], - [ 2, -2, 1], - [-1, 3, 7]]) +array([[ 11, 12, 13], + [ 21, -22, 23], + [ 31, 32, 33]]) -In []: c[1] = [0,0,0] +In []: c[1] = 0 In []: c Out[]: -array([[ 1, 1, 2], +array([[11, 12, 13], [ 0, 0, 0], - [-1, 3, 7]]) + [31, 32, 33]]) \end{lstlisting} \end{small} How to change one \alert{column}? @@ -214,20 +214,20 @@ How to change one \alert{column}? \begin{small} \begin{lstlisting} In []: c[:,1] -Out[]: array([1, 0, 3]) +Out[]: array([12, 0, 32]) In []: c[1,:] Out[]: array([0, 0, 0]) In []: c[0:2,:] Out[]: -array([[1, 1, 2], - [0, 0, 0]]) +array([[11, 12, 13], + [ 0, 0, 0]]) In []: c[1:3,:] Out[]: array([[ 0, 0, 0], - [-1, 3, 7]]) + [31, 32, 33]]) \end{lstlisting} \end{small} \end{frame} @@ -238,18 +238,18 @@ array([[ 0, 0, 0], \begin{lstlisting} In []: c[:2,:] Out[]: -array([[1, 1, 2], - [0, 0, 0]]) +array([[11, 12, 13], + [ 0, 0, 0]]) In []: c[1:,:] Out[]: array([[ 0, 0, 0], - [-1, 3, 7]]) + [31, 32, 33]]) In []: c[1:,:2] Out[]: array([[ 0, 0], - [-1, 3]]) + [31, 32]]) \end{lstlisting} \end{small} @@ -261,19 +261,19 @@ array([[ 0, 0], \begin{lstlisting} In []: c[::2,:] Out[]: -array([[ 1, 1, 2], - [-1, 3, 7]]) +array([[11, 12, 13], + [31, 32, 33]]) In []: c[:,::2] Out[]: -xarray([[ 1, 2], +array([[11, 13], [ 0, 0], - [-1, 7]]) + [31, 33]]) In []: c[::2,::2] Out[]: -array([[ 1, 2], - [-1, 7]]) +array([[11, 13], + [31, 33]]) \end{lstlisting} \end{small} \end{frame} @@ -477,11 +477,16 @@ Out[]: array([-1., 8., -1.]) \begin{frame} \frametitle{Least Square Fit Curve} +\begin{center} \begin{itemize} -\item $T^2$ and $L$ have a linear relationship -\item Hence, Least Square Fit Curve is a line -\item we shall use the \typ{lstsq} function +\item $L \alpha T^2$ +\item Best Fit Curve $\rightarrow$ Linear + \begin{itemize} + \item Least Square Fit + \end{itemize} +\item \typ{lstsq()} \end{itemize} +\end{center} \end{frame} \begin{frame}[fragile] -- cgit