diff options
author | Puneeth Chaganti | 2010-01-21 17:14:52 +0530 |
---|---|---|
committer | Puneeth Chaganti | 2010-01-21 17:14:52 +0530 |
commit | e511cc4c6a0b04b83ff6731ee7cc113d9729e783 (patch) | |
tree | 172b1467de977efb32edb7e85a3433c4502d5954 /day1/session3.tex | |
parent | 8622ffa26f8da8ed8c4409a23a9d8d2cf2c86469 (diff) | |
download | workshops-e511cc4c6a0b04b83ff6731ee7cc113d9729e783.tar.gz workshops-e511cc4c6a0b04b83ff6731ee7cc113d9729e783.tar.bz2 workshops-e511cc4c6a0b04b83ff6731ee7cc113d9729e783.zip |
Fixed errors found during REC workshop.
Diffstat (limited to 'day1/session3.tex')
-rw-r--r-- | day1/session3.tex | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/day1/session3.tex b/day1/session3.tex index 567a12c..135bfc1 100644 --- a/day1/session3.tex +++ b/day1/session3.tex @@ -142,13 +142,13 @@ \begin{frame}[fragile] \frametitle{Acceleration due to gravity - ``g''\ldots} \begin{lstlisting} -In []: G = [] +In []: g_list = [] In []: for line in open('pendulum.txt'): .... point = line.split() .... l = float(point[0]) .... t = float(point[1]) .... g = 4 * pi * pi * l / (t * t) - .... G.append(g) + .... g_list.append(g) \end{lstlisting} \end{frame} @@ -163,11 +163,11 @@ In []: for line in open('pendulum.txt'): \frametitle{Mean ``g''} \begin{lstlisting} In []: total = 0 -In []: for g in G: +In []: for g in g_list: ....: total += g ....: -In []: g_mean = total / len(G) +In []: g_mean = total / len(g_list) In []: print 'Mean: ', g_mean \end{lstlisting} \end{frame} @@ -175,7 +175,7 @@ In []: print 'Mean: ', g_mean \begin{frame}[fragile] \frametitle{Mean ``g''} \begin{lstlisting} -In []: g_mean = sum(G) / len(G) +In []: g_mean = sum(g_list) / len(g_list) In []: print 'Mean: ', g_mean \end{lstlisting} \end{frame} @@ -183,7 +183,7 @@ In []: print 'Mean: ', g_mean \begin{frame}[fragile] \frametitle{Mean ``g''} \begin{lstlisting} -In []: g_mean = mean(G) +In []: g_mean = mean(g_list) In []: print 'Mean: ', g_mean \end{lstlisting} \inctime{10} @@ -333,7 +333,6 @@ science = {} science = {} for record in open('sslc1.txt'): - record = record.strip() fields = record.split(';') region_code = fields[0].strip() @@ -396,7 +395,6 @@ savefig('science.png') math_scores = [] for record in open('sslc1.txt'): - record = record.strip() fields = record.split(';') score_str = fields[5].strip() |