day1/session2.tex
changeset 159 01f57cda252f
parent 158 978108b0c02c
parent 156 6a1388c456f4
child 160 058fad7c7d1d
equal deleted inserted replaced
158:978108b0c02c 159:01f57cda252f
   191   Out[]: [<matplotlib.lines.Line2D object at 0xac17e0c>]
   191   Out[]: [<matplotlib.lines.Line2D object at 0xac17e0c>]
   192 \end{lstlisting}
   192 \end{lstlisting}
   193 \end{frame}
   193 \end{frame}
   194 
   194 
   195 \begin{frame}[fragile]
   195 \begin{frame}[fragile]
   196 \frametitle{Plotting Attributes}
   196 \frametitle{Additional Plotting Attributes}
   197 \begin{itemize}
   197 \begin{itemize}
   198   \item \kwrd{'o'} - Dots
   198   \item \kwrd{'o'} - Dots
       
   199   \item \kwrd{'.'} - Smaller Dots
   199   \item \kwrd{'-'} - Lines
   200   \item \kwrd{'-'} - Lines
   200   \item \kwrd{'- -'} - Dashed lines
   201   \item \kwrd{'- -'} - Dashed lines
   201 \end{itemize}
   202 \end{itemize}
   202 \end{frame}
   203 \end{frame}
   203 
   204 
   204 \begin{frame}[fragile]
   205 \begin{frame}[fragile]
   205 \frametitle{Plotting \it{L} vs \it{T^2}}
   206 \frametitle{Plotting $L$ vs. $T^2$}
       
   207 \begin{itemize}
       
   208 \item We must square each of the values in T
       
   209 \item How to do it?
       
   210 \item T is a \kwrd{list} and we use a \kwrd{for} loop to iterate over it
       
   211 \end{itemize}
       
   212 \end{frame}
       
   213 
       
   214 \begin{frame}[fragile]
       
   215 \frametitle{Plotting $L$ vs $T^2$}
   206 \begin{lstlisting}
   216 \begin{lstlisting}
   207 In []: TSq = []
   217 In []: TSq = []
   208 
   218 
   209 In []: for t in T:
   219 In []: for t in T:
   210  ....:     TSq.append(t*t)
   220  ....:     TSq.append(t*t)
   223 
   233 
   224 \section{Lists}
   234 \section{Lists}
   225 \begin{frame}[fragile]
   235 \begin{frame}[fragile]
   226   \frametitle{How to create and use lists?}
   236   \frametitle{How to create and use lists?}
   227 \begin{lstlisting}
   237 \begin{lstlisting}
       
   238 In []: mtlist = [] #Empty List
       
   239 
   228 In []: lst = [1,2,3,4] 
   240 In []: lst = [1,2,3,4] 
   229 
   241 
   230 In []: lst[0]+lst[1]+lst[-1]
   242 In []: lst[0]+lst[1]+lst[-1]
   231 Out[]: 7
   243 Out[]: 7
   232 \end{lstlisting}
   244 \end{lstlisting}
   304 Out[]: ['KD', 'MCS', 'PC', 'SC', 'SV']
   316 Out[]: ['KD', 'MCS', 'PC', 'SC', 'SV']
   305   \end{lstlisting}
   317   \end{lstlisting}
   306 \inctime{5}
   318 \inctime{5}
   307 \end{frame}
   319 \end{frame}
   308 
   320 
   309 \section{Plotting points}
       
   310 
       
   311 
       
   312 \end{document}
   321 \end{document}