day1/session3.tex
changeset 185 e59ab9ab1a89
parent 184 9efa777af2e2
child 192 1574b3bc6be7
child 199 85a799d90c6a
equal deleted inserted replaced
184:9efa777af2e2 185:e59ab9ab1a89
   301 
   301 
   302 \begin{frame}[fragile]
   302 \begin{frame}[fragile]
   303 \frametitle{Dealing with data whole-sale}
   303 \frametitle{Dealing with data whole-sale}
   304 \begin{lstlisting}
   304 \begin{lstlisting}
   305 In []: for t in T:
   305 In []: for t in T:
   306  ....:     Tsq.append(t*t)
   306  ....:     TSq.append(t*t)
   307 \end{lstlisting}
   307 \end{lstlisting}
   308 \begin{itemize}
   308 \begin{itemize}
   309 \item This is not very efficient
   309 \item This is not very efficient
   310 \item We are squaring element after element
   310 \item We are squaring element after element
   311 \item We use arrays to make this efficient
   311 \item We use arrays to make this efficient
   312 \end{itemize}
   312 \end{itemize}
   313 \begin{lstlisting}
   313 \begin{lstlisting}
   314 In []: L = array(L)
   314 In []: L = array(L)
   315 In []: T = array(T)
   315 In []: T = array(T)
   316 In []: Tsq = T*T
   316 In []: TSq = T*T
   317 \end{lstlisting}
   317 \end{lstlisting}
   318 \end{frame}
   318 \end{frame}
   319 
   319 
   320 \begin{frame}[fragile]
   320 \begin{frame}[fragile]
   321 \frametitle{Arrays}
   321 \frametitle{Arrays}
   399 \begin{itemize}
   399 \begin{itemize}
   400 \item Now use the \typ{lstsq} function
   400 \item Now use the \typ{lstsq} function
   401 \item Along with a lot of things, it returns the least squares solution
   401 \item Along with a lot of things, it returns the least squares solution
   402 \end{itemize}
   402 \end{itemize}
   403 \begin{lstlisting}
   403 \begin{lstlisting}
   404 In []: coef, res, r, s = lstsq(A,Tsq)
   404 In []: coef, res, r, s = lstsq(A,TSq)
   405 \end{lstlisting}
   405 \end{lstlisting}
   406 \end{frame}
   406 \end{frame}
   407 
   407 
   408 \begin{frame}[fragile]
   408 \begin{frame}[fragile]
   409 \frametitle{Least Square Fit Line \ldots}
   409 \frametitle{Least Square Fit Line \ldots}
   422 \begin{frame}[fragile]
   422 \begin{frame}[fragile]
   423   \frametitle{What did we learn?}
   423   \frametitle{What did we learn?}
   424   \begin{itemize}
   424   \begin{itemize}
   425    \item Dictionaries
   425    \item Dictionaries
   426    \item Drawing pie charts
   426    \item Drawing pie charts
       
   427    \item Arrays
       
   428    \item Least Square fitting
       
   429    \item Intro to Matrices
   427   \end{itemize}
   430   \end{itemize}
   428 \end{frame}
   431 \end{frame}
   429 \end{document}
   432 \end{document}