diff options
author | Madhusudan.C.S | 2009-10-26 14:23:49 +0530 |
---|---|---|
committer | Madhusudan.C.S | 2009-10-26 14:23:49 +0530 |
commit | 0715a39b9f7ee060e04c87f3f784655403b6b9ae (patch) | |
tree | 3bbea472c89c14d5e1a6769e2ad30101de64145a | |
parent | 4e2d9247cc324cee2a7a7fc423d893c6dd58764b (diff) | |
download | workshops-0715a39b9f7ee060e04c87f3f784655403b6b9ae.tar.gz workshops-0715a39b9f7ee060e04c87f3f784655403b6b9ae.tar.bz2 workshops-0715a39b9f7ee060e04c87f3f784655403b6b9ae.zip |
Reorganized the slides for sslc1.txt.
-rw-r--r-- | day1/session3.tex | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/day1/session3.tex b/day1/session3.tex index 47921f1..997fea3 100644 --- a/day1/session3.tex +++ b/day1/session3.tex @@ -311,8 +311,8 @@ data = {} # is an empty dictionary \item In this problem let the value of a \emph{key} be another dictionary. \item This dictionary contains: \begin{itemize} - \item 'marks': A \emph{list} of NumPy arrays - \item 'total': Total marks of each student + \item 'marks': A \emph{List} of \emph{Lists} containing all marks + \item 'total': A \emph{List} of total marks of each student \item 'P': Number of passes \item 'F': Number of failures \item 'W': Number of withdrawls @@ -362,11 +362,6 @@ total = 0 if score_str == 'AA' or score_str == '' else int(fields[8]) data[fields[0]]['total'].append(total) - -pfw_key = fields[9] - or fields[10] - or 'F' -data[fields[0]][pfw_key] += 1 \end{lstlisting} \end{frame} @@ -381,13 +376,25 @@ data[fields[0]][pfw_key] += 1 \end{frame} \begin{frame}[fragile] + \frametitle{NumPy arrays} + \centerline{\alert{But I lied!?!?!?}} +\end{frame} + +\begin{frame}[fragile] \frametitle{Calculations} - \small \begin{lstlisting} for k in data: - data[k]['marks'] = array(data[k]['marks']) - data[k]['total'] = array(data[k]['total']) + data[k]['marks'] = array( + data[k]['marks']) + data[k]['total'] = array( + data[k]['total']) + \end{lstlisting} +\end{frame} +\begin{frame}[fragile] + \frametitle{Calculations} + \small + \begin{lstlisting} data[k]['avg'] = average( data[k]['total']) marks = data[k]['marks'] @@ -408,7 +415,7 @@ for k in data: \item New type of conditional \item NumPy arrays \item Slicing NumPy arrays - \item NumPy array operations - square, average, sqrt + \item NumPy array functions - square, average, sqrt \end{itemize} \end{frame} |