Changed in Plotting data and merged heads
authorAmit Sethi
Wed, 10 Nov 2010 02:12:09 +0530
changeset 434 c8ffd52305ff
parent 433 f121a3598ad9 (current diff)
parent 431 9bf92931d1ee (diff)
child 435 975677bf1b8a
child 441 430035b678f7
Changed in Plotting data and merged heads
plotting-data/script.rst
plotting-data/slides.org
plotting-data/slides.tex
--- a/getting-started-with-lists/script.rst	Tue Nov 09 23:26:39 2010 +0530
+++ b/getting-started-with-lists/script.rst	Wed Nov 10 02:12:09 2010 +0530
@@ -20,17 +20,19 @@
 ..   #. basic datatypes
      
 .. Author              : Amit 
-   Internal Reviewer   : 
+   Internal Reviewer   : Anoop Jacob Thomas <anoop@fossee.in>
    External Reviewer   :
    Checklist OK?       : <put date stamp here, if OK> [2010-10-05]
 
+.. #[[Anoop: Slides contain only outline and summary
+
 Script
 ------
+ {{{ Show the slide containing title }}}
+
 Hello friends and welcome to the tutorial on getting started with
 lists.
 
- {{{ Show the slide containing title }}}
-
  {{{ Show the slide containing the outline slide }}}
 
 In this tutorial we will be getting acquainted with a python data
@@ -40,12 +42,16 @@
  * Structure of lists
  * Access list elements
  * Append elements to lists
- * Deleting elements from lists
+ * Delete elements from lists
 
 List is a compound data type, it can contain data of other data
 types. List is also a sequence data type, all the elements are in
 order and there order has a meaning.
 
+.. #[[Anoop: "all the elements are in order and **there** order has a
+   meaning." - I guess something is wrong here, I am not able to
+   follow this.]]
+
 We will first create an empty list with no elements. On your IPython
 shell type ::
 
@@ -55,43 +61,50 @@
 
 This is an empty list without any elements.
 
-* Filled lists
+.. #[[Anoop: the document has to be continous, without any
+   subheadings, removing * Filled lists]]
 
-Lets now define a list, nonempty and fill it with some random elements.
+Lets now see how to define a non-empty list. We do it as,::
 
-nonempty = ['spam', 'eggs', 100, 1.234]
+     nonempty = ['spam', 'eggs', 100, 1.234]
 
 Thus the simplest way of creating a list is typing out a sequence 
 of comma-separated values (items) between square brackets. 
-All the list items need not have the same data type.
-
-
+All the list items need not be of the same data type.
 
 As we can see lists can contain different kinds of data. In the
-previous example 'spam' and 'eggs' are strings and 100 and 1.234
+previous example 'spam' and 'eggs' are strings and 100 and 1.234 are
 integer and float. Thus we can put elements of heterogenous types in
 lists. Thus list themselves can be one of the element types possible
-in lists. Thus lists can also contain other lists.  Example ::
+in lists. Thus lists can also contain other lists.  
+
+.. #[[Anoop: the sentence "Thus list themselves can be one of the
+   element types possible in lists" is not clear, rephrase it.]]
+
+Example ::
 
       list_in_list=[[4,2,3,4],'and', 1, 2, 3, 4]
 
-We access list elements using the number of index. The
-index begins from 0. So for list nonempty, nonempty[0] gives the
-first element, nonempty[1] the second element and so on and
-nonempty[3] the last element. ::
+We access list elements using the index. The index begins from 0. So
+for list nonempty, nonempty[0] gives the first element, nonempty[1]
+the second element and so on and nonempty[3] the last element. ::
 
 	    nonempty[0] 
 	    nonempty[1] 
 	    nonempty[3]
 
+.. #[[Anoop: was negative indices introduced earlier, if not may be we
+   can ask them to try out nonempty[-1] and see what happens and then
+   tell that it gives the last element in the list.]]
+
 We can also access the elememts from the end using negative indices ::
    
    nonempty[-1] 
    nonempty[-2] 
    nonempty[-4]
 
--1 gives the last element which is the 4th element , -2 second to last and -4 gives the fourth
-from last element which is first element.
+-1 gives the last element which is the 4th element , -2 second to last
+and -4 gives the fourth from last element which is first element.
 
 We can append elements to the end of a list using append command. ::
 
@@ -102,10 +115,8 @@
    
 As we can see non empty appends 'onemore' and 6 at the end.
 
-
-
 Using len function we can check the number of elements in the list
-nonempty. In this case it being 6 ::
+nonempty. In this case it 6 ::
 	 
 	 len(nonempty)
 
@@ -121,11 +132,20 @@
 deletes the element at index 1, i.e the second element of the
 list, 'eggs'. The other way is removing element by content. Lets say
 one wishes to delete 100 from nonempty list the syntax of the command
-should be :: 
-      
-      nonempty.remove(100)
+should be 
 
-but what if their were two 100's. To check that lets do a small
+.. #[[Anoop: let x = [1,2,1,3]
+   	     now x.remove(x[2])
+	     still x is [2,1,3] so that is not the way to remove
+	     element by index, it removed first occurrence of 1(by
+	     content) and not based on index, so make necessary
+	     changes]]
+
+::
+
+    nonempty.remove(100)
+
+but what if there were two 100's. To check that lets do a small
 experiment. ::
 
 	   nonempty.append('python') 
@@ -133,10 +153,14 @@
 	   nonempty.remove('python') 
 	   nonempty
 
-If we check a now we will see that the first occurence 'spam' is removed
+If we check now we will see that the first occurence 'spam' is removed
 thus remove removes the first occurence of the element in the sequence
 and leaves others untouched.
 
+.. #[[Anoop: does it have two spams or two pythons?]]
+
+.. #[[Anoop: there are no exercises/solved problems in this script,
+   add them]]
 
 {{{Slide for Summary }}}
 
@@ -151,7 +175,7 @@
  
 
 
-{{{ Sponsored by Fossee Slide }}}
+{{{ show Sponsored by Fossee Slide }}}
 
 This tutorial was created as a part of FOSSEE project.
 
@@ -159,7 +183,7 @@
 
 Thank You
 
-
+..
  * Author : Amit Sethi 
  * First Reviewer : 
  * Second Reviewer : Nishanth
--- a/getting-started-with-lists/slides.tex	Tue Nov 09 23:26:39 2010 +0530
+++ b/getting-started-with-lists/slides.tex	Wed Nov 10 02:12:09 2010 +0530
@@ -1,106 +1,64 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%Tutorial slides on Python.
-%
-% Author: FOSSEE 
-% Copyright (c) 2009, FOSSEE, IIT Bombay
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\documentclass[14pt,compress]{beamer}
-%\documentclass[draft]{beamer}
-%\documentclass[compress,handout]{beamer}
-%\usepackage{pgfpages} 
-%\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm]
-
-% Modified from: generic-ornate-15min-45min.de.tex
-\mode<presentation>
-{
-  \usetheme{Warsaw}
-  \useoutertheme{infolines}
-  \setbeamercovered{transparent}
-}
-
-\usepackage[english]{babel}
+% Created 2010-11-09 Tue 17:41
+\documentclass[presentation]{beamer}
 \usepackage[latin1]{inputenc}
-%\usepackage{times}
 \usepackage[T1]{fontenc}
-
-\usepackage{ae,aecompl}
-\usepackage{mathpazo,courier,euler}
-\usepackage[scaled=.95]{helvet}
-
-\definecolor{darkgreen}{rgb}{0,0.5,0}
+\usepackage{fixltx2e}
+\usepackage{graphicx}
+\usepackage{longtable}
+\usepackage{float}
+\usepackage{wrapfig}
+\usepackage{soul}
+\usepackage{t1enc}
+\usepackage{textcomp}
+\usepackage{marvosym}
+\usepackage{wasysym}
+\usepackage{latexsym}
+\usepackage{amssymb}
+\usepackage{hyperref}
+\tolerance=1000
+\providecommand{\alert}[1]{\textbf{#1}}
 
-\usepackage{listings}
-\lstset{language=Python,
-    basicstyle=\ttfamily\bfseries,
-    commentstyle=\color{red}\itshape,
-  stringstyle=\color{darkgreen},
-  showstringspaces=false,
-  keywordstyle=\color{blue}\bfseries}
+\title{Getting started with Lists}
+\author{FOSSEE}
+\date{2010-09-14 Tue}
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Macros
-\setbeamercolor{emphbar}{bg=blue!20, fg=black}
-\newcommand{\emphbar}[1]
-{\begin{beamercolorbox}[rounded=true]{emphbar} 
-      {#1}
- \end{beamercolorbox}
-}
-\newcounter{time}
-\setcounter{time}{0}
-\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}}
-
-\newcommand{\typ}[1]{\lstinline{#1}}
-
-\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}}  }
-
-% Title page
-\title{Your Title Here}
-
-\author[FOSSEE] {FOSSEE}
-
-\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
-\date{}
-
-% DOCUMENT STARTS
+\usetheme{Warsaw}\useoutertheme{infolines}\usecolortheme{default}\setbeamercovered{transparent}
 \begin{document}
 
-\begin{frame}
-  \maketitle
-\end{frame}
+\maketitle
 
-\begin{frame}[fragile]
-  \frametitle{Outline}
-  \begin{itemize}
-    \item 
-  \end{itemize}
-\end{frame}
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%              All other slides here.                  %%
-%% The same slides will be used in a classroom setting. %% 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 
-\begin{frame}[fragile]
-  \frametitle{Summary}
-  \begin{itemize}
-    \item 
-  \end{itemize}
-\end{frame}
+
 
 \begin{frame}
-  \frametitle{Thank you!}  
-  \begin{block}{}
-  \begin{center}
-  This spoken tutorial has been produced by the
-  \textcolor{blue}{FOSSEE} team, which is funded by the 
-  \end{center}
-  \begin{center}
-    \textcolor{blue}{National Mission on Education through \\
-      Information \& Communication Technology \\ 
-      MHRD, Govt. of India}.
-  \end{center}  
-  \end{block}
+\frametitle{Tutorial Plan}
+\label{sec-1}
+\begin{itemize}
+
+\item How to create lists\\
+\label{sec-1_1}%
+\item Structure of lists\\
+\label{sec-1_2}%
+\item Access list elements\\
+\label{sec-1_3}%
+\item Append elements to lists\\
+\label{sec-1_4}%
+\item Deleting elements from lists\\
+\label{sec-1_5}%
+\end{itemize} % ends low level
+\end{frame}
+\begin{frame}
+\frametitle{Summary}
+\label{sec-2}
+
+
+  l=[1,2,3,4]
+  l[-1]
+  l.append(5)
+  del(l\footnote{FOOTNOTE DEFINITION NOT FOUND: 2 })
+  len(l)
 \end{frame}
 
 \end{document}
--- a/manipulating-lists/quickref.tex	Tue Nov 09 23:26:39 2010 +0530
+++ b/manipulating-lists/quickref.tex	Wed Nov 10 02:12:09 2010 +0530
@@ -1,8 +1,10 @@
-Creating a linear array:\\
-{\ex \lstinline|    x = linspace(0, 2*pi, 50)|}
+Slicing \& Striding a list:\\
+{\ex \lstinline|    A[start:stop:step]|} \lstinline|stop| excluded
 
-Plotting two variables:\\
-{\ex \lstinline|    plot(x, sin(x))|}
+Sorting a list:\\
+{\ex \lstinline|    sorted(A)|} -- returns new list
+{\ex \lstinline|    A.sort()|} -- in-place sort
 
-Plotting two lists of equal length x, y:\\
-{\ex \lstinline|    plot(x, y)|}
+Reversing a list:\\
+{\ex \lstinline|    A[::-1]|} -- returns new list
+{\ex \lstinline|    A.reverse()|} -- in-place reverse
--- a/manipulating-lists/script.rst	Tue Nov 09 23:26:39 2010 +0530
+++ b/manipulating-lists/script.rst	Wed Nov 10 02:12:09 2010 +0530
@@ -22,13 +22,12 @@
 
 Hello friends. Welcome to this spoken tutorial on Manipulating Lists. 
 
-
 {{{ Show the slide containing the outline }}}
 
 We have already learnt a lot about Lists in Python. In this tutorial,
 we will learn more about advanced features of Lists in Python. We will
-see in detail how to concatenate two lists, slicing and striding of
-lists, methods to sort and reverse the list.
+see how to concatenate two lists, details of slicing and striding of
+lists, methods to sort and reverse lists.
 
 {{{ Shift to terminal and start ipython }}}
 
@@ -40,8 +39,8 @@
 
 We already know what Lists are in Python, how to access individual
 elements in the list and some of the functions that can be run on the
-lists like max, min, sum len and so on. Now let us learn some of the
-basic operations that can be performed on Lists.
+lists like ``max, min, sum, len`` and so on. Now let us learn some of
+the basic operations that can be performed on Lists.
 
 We already know how to access individual elements in a List. But what
 if we have a scenario where we need to get a part of the entire list
@@ -64,6 +63,18 @@
 was the element with the index 4 was included but 23 which was the
 element with index 8 was excluded.
 
+Following is an exercise you must do. 
+
+%% %% Obtain the primes less than 10, from the list ``primes``. 
+
+Please, pause the video here, do the exercise and then resume. 
+
+::
+
+  primes[0:4]
+
+will give us the primes below 10. 
+
 Generalizing, we can obtain a slice of the list "p" from the index
 "start" upto the index "end" but excluding "end" with the following
 syntax
@@ -79,12 +90,12 @@
   num = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
 
 If we want to obtain all the odd numbers less than 10 from the list
-"num" we have to start from element with index 1 upto the index 10 in
+``num`` we have to start from element with index 1 upto the index 10 in
 steps of 2::
 
   num[1:10:2]
 
-So if we don't specify the step it is by default 1. Similary there are
+When no step is specified, it is assumed to be 1. Similarly, there are
 default values for start and stop indices as well. If we don't specify
 the start index it is implicitly taken as the first element of the
 list::
@@ -105,6 +116,19 @@
 
 gives us all the even numbers in the list "num".
 
+Following is an exercise that you must do. 
+
+%% %% Obtain all the multiples of three from the list ``num``.
+
+Please, pause the video here. Do the exercise and then continue. 
+
+::
+
+  num[::3]
+
+gives us all the multiples of 3 from the list, since every third
+element in it, starting from 0, is divisible by 3. 
+
 The other basic operation that we can perform on list is concatenation
 of two or more lists. We can combine two lists by using the "plus"
 operator. Say we have
@@ -122,17 +146,16 @@
   c
 
 It is important to observe that the "plus" operator always returns a
-new list without touching anything in the existing lists which are the
-operands of the concatenation operation.
+new list without altering the lists being concatenated in any way. 
 
-We know that list is a collection of data. Whenever we have a
-collection we run into situations where we want to start the
+We know that a list is a collection of data. Whenever we have a
+collection we run into situations where we want to sort the
 collection. Lists support sort method which sorts the list inplace::
 
   a = [5, 1, 6, 7, 7, 10]
   a.sort()
 
-Now the contents of the list "a" will be::
+Now the contents of the list ``a`` will be::
 
   a
   [1, 5, 6, 7, 7, 10]
@@ -164,27 +187,46 @@
   a
   [5, 4, 3, 2, 1]
 
-But again the original list is lost. If we want to obtain the reverse
-of a list keeping the original list intact we can use the Python
-built-in function reversed. reversed function returns a new list which
-is the reverse of the list which was passed as the argument to the
-reversed function::
+But again the original list is lost. 
+.. #[punch: removed reversed, since it returns an iterator]
 
-  a = [1, 2, 3, 4, 5]
-  reversed(a)
+To reverse a list, we could use striding with negative indexing.::
+
+   a[::-1]
 
 We can also store this new reversed list in another list variable.
 
+Following is an (are) exercise(s) that you must do. 
+
+%% %% Given a list of marks of students in an examination, obtain a
+      list with marks in descending order.
+      ::
+
+            marks = [99, 67, 47, 100, 50, 75, 62]
+
+Please, pause the video here. Do the exercise(s) and then continue. 
+
+::
+
+  sorted(marks)[::-1]
+
+OR
+
+::
+
+  sorted(marks, reverse = True)
+
+
+
 {{{ Show summary slide }}}
 
 This brings us to the end of another session. In this tutorial session
 we learnt
 
-  * How to define strings
-  * Different types of defining a string
-  * String concatenation and repeatition
-  * Accessing individual elements of the string
-  * Immutability of strings
+  * Obtaining parts of lists using slicing and striding
+  * List concatenation
+  * Sorting lists 
+  * Reversing lists
 
 {{{ Show the "sponsored by FOSSEE" slide }}}
 
--- a/manipulating-lists/slides.org	Tue Nov 09 23:26:39 2010 +0530
+++ b/manipulating-lists/slides.org	Wed Nov 10 02:12:09 2010 +0530
@@ -18,7 +18,7 @@
 #+LaTeX_HEADER:  commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
 #+LaTeX_HEADER:  showstringspaces=false, keywordstyle=\color{blue}\bfseries}
 
-#+TITLE:    Accessing parts of arrays
+#+TITLE:    Manipulating Lists
 #+AUTHOR:    FOSSEE
 #+EMAIL:     
 #+DATE:    
@@ -28,83 +28,54 @@
 #+LANGUAGE:  en
 #+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
 #+OPTIONS:   TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc
+#+STARTUP:    align fold nodlcheck hidestars oddeven lognotestate
 
 * Outline
-  - Manipulating one and multi dimensional arrays
-  - Access and change individual elements 
-  - Access and change rows and columns 
-  - Slicing and striding on arrays to access chunks 
-  - Read images into arrays and manipulations
-* Sample Arrays
-  #+begin_src python
-    In []: A = array([12, 23, 34, 45, 56])
-    
-    In []: C = array([[11, 12, 13, 14, 15],
-                      [21, 22, 23, 24, 25],
-                      [31, 32, 33, 34, 35],
-                      [41, 42, 43, 44, 45],
-                      [51, 52, 53, 54, 55]])
-    
-  #+end_src
+  In this session we shall be looking at 
+  - Concatenating lists
+  - Obtaining parts of lists
+  - Sorting lists
+  - Reversing lists
 * Question 1
-  Change the last column of ~C~ to zeroes. 
+  Obtain the primes less than 10, from the list ~primes~. 
 * Solution 1
   #+begin_src python
-    In []:  C[:, -1] = 0
-  #+end_src
+    primes[0:4]
+  #+end_src python
+* Slicing
+  #+begin_src python
+    p[start:stop]
+  #+end_src python
+  - Returns all elements of ~p~ between ~start~ and ~stop~
+  - The element with index equal to ~stop~ is *not* included. 
 * Question 2
-  Change ~A~ to ~[11, 12, 13, 14, 15]~. 
+  Obtain all the multiples of three from the list ~num~.
 * Solution 2
   #+begin_src python
-    In []:  A[:] = [11, 12, 13, 14, 15]
-  #+end_src
-* squares.png
-  #+begin_latex
-    \begin{center}
-      \includegraphics[scale=0.6]{squares}    
-    \end{center}
-  #+end_latex
+    num[::3]  
+  #+end_src python
 * Question 3
-  - obtain ~[22, 23]~ from ~C~. 
-  - obtain ~[11, 21, 31, 41]~ from ~C~. 
-  - obtain ~[21, 31, 41, 0]~.   
+  Given a list of marks of students in an examination, obtain a list
+  with marks in descending order.
+  #+begin_src python
+    marks = [99, 67, 47, 100, 50, 75, 62]
+  #+end_src python
 * Solution 3
   #+begin_src python
-    In []:  C[1, 1:3]
-    In []:  C[0:4, 0]
-    In []:  C[1:5, 0]
-  #+end_src
-* Question 4
-  Obtain ~[[23, 24], [33, -34]]~ from ~C~
-* Solution 4
-  #+begin_src python
-    In []:  C[1:3, 2:4]
-  #+end_src
-* Question 5
-  Obtain the square in the center of the image
-* Solution 5
+    sorted(marks)[::-1]
+  #+end_src python
+OR
   #+begin_src python
-    In []: imshow(I[75:225, 75:225])
-  #+end_src
-* Question 6
-  Obtain the following
-  #+begin_src python
-    [[12, 0], [42, 0]]
-    [[12, 13, 14], [0, 0, 0]]
-  #+end_src
+    sorted(marks, reverse=True)
+  #+end_src python
 
-* Solution 6
-  #+begin_src python
-    In []: C[::3, 1::3]
-    In []: C[::4, 1:4]
-  #+end_src
 * Summary
-  You should now be able to --
-  - Manipulate 1D \& Multi dimensional arrays
-      - Access and change individual elements 
-      - Access and change rows and columns 
-      - Slice and stride on arrays
-  - Read images into arrays and manipulate them.
+  In this tutorial session we learnt
+    + Obtaining parts of lists using slicing and striding
+    + List concatenation
+    + Sorting lists 
+    + Reversing lists
+
 * Thank you!
 #+begin_latex
   \begin{block}{}
--- a/manipulating-lists/slides.tex	Tue Nov 09 23:26:39 2010 +0530
+++ b/manipulating-lists/slides.tex	Wed Nov 10 02:12:09 2010 +0530
@@ -1,95 +1,141 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%Tutorial slides on Python.
-%
-% Author: FOSSEE 
-% Copyright (c) 2009, FOSSEE, IIT Bombay
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\documentclass[14pt,compress]{beamer}
-%\documentclass[draft]{beamer}
-%\documentclass[compress,handout]{beamer}
-%\usepackage{pgfpages} 
-%\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm]
-
-% Modified from: generic-ornate-15min-45min.de.tex
-\mode<presentation>
-{
-  \usetheme{Warsaw}
-  \useoutertheme{infolines}
-  \setbeamercovered{transparent}
-}
-
-\usepackage[english]{babel}
+% Created 2010-11-09 Tue 16:07
+\documentclass[presentation]{beamer}
 \usepackage[latin1]{inputenc}
-%\usepackage{times}
 \usepackage[T1]{fontenc}
-
-\usepackage{ae,aecompl}
-\usepackage{mathpazo,courier,euler}
-\usepackage[scaled=.95]{helvet}
+\usepackage{fixltx2e}
+\usepackage{graphicx}
+\usepackage{longtable}
+\usepackage{float}
+\usepackage{wrapfig}
+\usepackage{soul}
+\usepackage{textcomp}
+\usepackage{marvosym}
+\usepackage{wasysym}
+\usepackage{latexsym}
+\usepackage{amssymb}
+\usepackage{hyperref}
+\tolerance=1000
+\usepackage[english]{babel} \usepackage{ae,aecompl}
+\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
+\usepackage{listings}
+\lstset{language=Python, basicstyle=\ttfamily\bfseries,
+commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
+showstringspaces=false, keywordstyle=\color{blue}\bfseries}
+\providecommand{\alert}[1]{\textbf{#1}}
 
-\definecolor{darkgreen}{rgb}{0,0.5,0}
-
-\usepackage{listings}
-\lstset{language=Python,
-    basicstyle=\ttfamily\bfseries,
-    commentstyle=\color{red}\itshape,
-  stringstyle=\color{darkgreen},
-  showstringspaces=false,
-  keywordstyle=\color{blue}\bfseries}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Macros
-\setbeamercolor{emphbar}{bg=blue!20, fg=black}
-\newcommand{\emphbar}[1]
-{\begin{beamercolorbox}[rounded=true]{emphbar} 
-      {#1}
- \end{beamercolorbox}
-}
-\newcounter{time}
-\setcounter{time}{0}
-\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}}
-
-\newcommand{\typ}[1]{\lstinline{#1}}
-
-\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}}  }
-
-% Title page
-\title{Your Title Here}
-
-\author[FOSSEE] {FOSSEE}
-
-\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
+\title{Manipulating Lists}
+\author{FOSSEE}
 \date{}
 
-% DOCUMENT STARTS
+\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
 \begin{document}
 
+\maketitle
+
+
+
+
+
+
+
+
+
 \begin{frame}
-  \maketitle
+\frametitle{Outline}
+\label{sec-1}
+
+  In this session we shall be looking at 
+\begin{itemize}
+\item Concatenating lists
+\item Obtaining parts of lists
+\item Sorting lists
+\item Reversing lists
+\end{itemize}
 \end{frame}
+\begin{frame}
+\frametitle{Question 1}
+\label{sec-2}
 
+  Obtain the primes less than 10, from the list \texttt{primes}. 
+\end{frame}
 \begin{frame}[fragile]
-  \frametitle{Outline}
-  \begin{itemize}
-    \item 
-  \end{itemize}
+\frametitle{Solution 1}
+\label{sec-3}
+
+\lstset{language=Python}
+\begin{lstlisting}
+primes[0:4]
+\end{lstlisting}
 \end{frame}
+\begin{frame}[fragile]
+\frametitle{Slicing}
+\label{sec-4}
+
+\lstset{language=Python}
+\begin{lstlisting}
+p[start:stop]
+\end{lstlisting}
+\begin{itemize}
+\item Returns all elements of \texttt{p} between \texttt{start} and \texttt{stop}
+\item The element with index equal to \texttt{stop} is \textbf{not} included.
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{Question 2}
+\label{sec-5}
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%              All other slides here.                  %%
-%% The same slides will be used in a classroom setting. %% 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  Obtain all the multiples of three from the list \texttt{num}.
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Solution 2}
+\label{sec-6}
 
+\lstset{language=Python}
+\begin{lstlisting}
+num[::3]
+\end{lstlisting}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Question 3}
+\label{sec-7}
+
+  Given a list of marks of students in an examination, obtain a list
+  with marks in descending order.
+\lstset{language=Python}
+\begin{lstlisting}
+marks = [99, 67, 47, 100, 50, 75, 62]
+\end{lstlisting}
+\end{frame}
 \begin{frame}[fragile]
-  \frametitle{Summary}
-  \begin{itemize}
-    \item 
-  \end{itemize}
+\frametitle{Solution 3}
+\label{sec-8}
+
+\lstset{language=Python}
+\begin{lstlisting}
+sorted(marks)[::-1]
+\end{lstlisting}
+OR
+\lstset{language=Python}
+\begin{lstlisting}
+sorted(marks, reverse=True)
+\end{lstlisting}
 \end{frame}
-
 \begin{frame}
-  \frametitle{Thank you!}  
+\frametitle{Summary}
+\label{sec-9}
+
+  In this tutorial session we learnt
+\begin{itemize}
+\item Obtaining parts of lists using slicing and striding
+\item List concatenation
+\item Sorting lists
+\item Reversing lists
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{Thank you!}
+\label{sec-10}
+
   \begin{block}{}
   \begin{center}
   This spoken tutorial has been produced by the
--- a/plotting-data/script.rst	Tue Nov 09 23:26:39 2010 +0530
+++ b/plotting-data/script.rst	Wed Nov 10 02:12:09 2010 +0530
@@ -194,16 +194,16 @@
 
 In this tutorial we have learnt :
 
-1. How to declare a sequence of number , specifically the kind of
-sequence we learned was a list.
+
 
-#. Plotting experimental data extending our knowledge from
-mathematical functions.
+1. How to declare a sequence of numbers.
+
+2. Plotting experimental data.
 
 #. The various options available for plotting dots instead of lines.
 
-#. Plotting experimental data such that we can also represent
-error. We did this using the errorbar() function.
+#. Plotting experimental data such that we can also represent error. 
+
 
 
  {{{ Show the "sponsored by FOSSEE" slide }}}
--- a/plotting-data/slides.org	Tue Nov 09 23:26:39 2010 +0530
+++ b/plotting-data/slides.org	Wed Nov 10 02:12:09 2010 +0530
@@ -177,11 +177,10 @@
   :         fmt='go')
 
 * Summary 
- : L = [0.1, 0.2, 0.3, 0.4, 0.5,                                             |
+ : L = [0.1, 0.2, 0.3, 0.4, 0.5,
  :      0.6, 0.7, 0.8, 0.9]  
  : plot(x,y,'o')
  : plot(x,y,'.')
- : errorbar(L,tsquare,xerr=delta_L, yerr=delta_T, fmt='b.')    
 * Thank you!
 #+begin_latex                                                                                                                                                
   \begin{block}{}                                                                                                                                            
@@ -198,3 +197,4 @@
 #+end_latex
 
 
+
--- a/plotting-data/slides.tex	Tue Nov 09 23:26:39 2010 +0530
+++ b/plotting-data/slides.tex	Wed Nov 10 02:12:09 2010 +0530
@@ -1,4 +1,4 @@
-% Created 2010-11-09 Tue 23:18
+% Created 2010-11-10 Wed 02:09
 \documentclass[presentation]{beamer}
 \usepackage[latin1]{inputenc}
 \usepackage[T1]{fontenc}
@@ -287,12 +287,27 @@
 \label{sec-15}
 
 \begin{verbatim}
-  L = [0.1, 0.2, 0.3, 0.4, 0.5,                                             |
+  L = [0.1, 0.2, 0.3, 0.4, 0.5,
        0.6, 0.7, 0.8, 0.9]  
   plot(x,y,'o')
   plot(x,y,'.')
-  errorbar(L,tsquare,xerr=delta_L, yerr=delta_T, fmt='b.')    
 \end{verbatim}
 \end{frame}
+\begin{frame}
+\frametitle{Thank you!}
+\label{sec-16}
+
+  \begin{block}{}                                                                                                                                            
+  \begin{center}                                                                                                                                             
+  This spoken tutorial has been produced by the                                                                                                              
+  \textcolor{blue}{FOSSEE} team, which is funded by the                                                                                                      
+  \end{center}                                                                                                                                               
+  \begin{center}                                                                                                                                             
+    \textcolor{blue}{National Mission on Education through \\                                                                                                
+      Information \& Communication Technology \\                                                                                                             
+      MHRD, Govt. of India}.                                                                                                                                 
+  \end{center}                                                                                                                                               
+  \end{block}                                                                                                                                                
+\end{frame}
 
 \end{document}
--- a/progress.org	Tue Nov 09 23:26:39 2010 +0530
+++ b/progress.org	Wed Nov 10 02:12:09 2010 +0530
@@ -9,11 +9,11 @@
 | 1.8 LO: | module level assessment                |     3 | Madhu    |                 |           |
 |---------+----------------------------------------+-------+----------+-----------------+-----------|
 | 2.2 LO: | loading data from files                |     3 | Punch    | Nishanth (Done) |           |
-| 2.3 LO: | plotting the data                      |     3 | Amit     | Pending         |           |
+| 2.3 LO: | plotting the data                      |     3 | Amit     | Anoop (Done)    |           |
 | 2.4 LO: | other types of plots                   |     3 | Anoop    | Punch (Done)    |           |
 | 2.5 LO: | module level assessment                |     3 | Nishanth |                 |           |
 |---------+----------------------------------------+-------+----------+-----------------+-----------|
-| 3.1 LO: | getting started with lists             |     2 | Amit     | Pending         |           |
+| 3.1 LO: | getting started with lists             |     2 | Amit     | Anoop(Done)     |           |
 | 3.2 LO: | getting started with =for=             |     2 | Anoop    | Nishanth (Done) |           |
 | 3.3 LO: | getting started with strings           |     2 | Madhu    |                 |           |
 | 3.4 LO: | getting started with files             |     3 | Punch    | Anoop(Done)     |           |
@@ -39,11 +39,11 @@
 | 6.4 LO: | loops                                  |     2 | Punch    | Anoop (Done)    |           |
 | 6.5 LO: | Assessment                             |     3 | Anoop    |                 |           |
 |---------+----------------------------------------+-------+----------+-----------------+-----------|
-| 7.1 LO: | manipulating lists                     |     3 | Madhu    | Punch (pending) |           |
-| 7.2 LO: | manipulating strings                   |     2 | Punch    | Amit(Done)      |           |
-| 7.3 LO: | getting started with tuples            |     2 | Nishanth |                 |           |
+| 7.1 LO: | manipulating lists                     |     3 | Madhu    | Punch (Done)    |           |
+| 7.2 LO: | manipulating strings                   |     2 | Punch    | Amit (Done)     |           |
+| 7.3 LO: | getting started with tuples            |     2 | Nishanth | Punch (Done)    |           |
 | 7.4 LO: | dictionaries                           |     2 | Anoop    | Punch (Done)    |           |
-| 7.5 LO: | sets                                   |     2 | Nishanth |                 |           |
+| 7.5 LO: | sets                                   |     2 | Nishanth | Punch (Done)    |           |
 | 7.6 LO: | Assessment                             |     3 | Amit     |                 |           |
 |---------+----------------------------------------+-------+----------+-----------------+-----------|
 | 8.1 LO: | getting started with functions         |     3 | Nishanth |                 |           |
--- a/sets/script.rst	Tue Nov 09 23:26:39 2010 +0530
+++ b/sets/script.rst	Wed Nov 10 02:12:09 2010 +0530
@@ -22,15 +22,15 @@
 Script
 ------
 
-Hello friends and welcome to the tutorial on Sets
+{{{ Show the slide containing title }}}
 
-{{{ Show the slide containing title }}}
+Hello friends and welcome to the tutorial on Sets
 
 {{{ Show the slide containing the outline slide }}}
 
 In this tutorial, we shall learn
 
- * sets
+ * sets 
  * operations on sets
 
 Sets are data structures which contain unique elements. In other words,
@@ -40,7 +40,7 @@
 type
 ::
  
-    a_list = [1, 2, 1, 4, 5, 6, 7]
+    a_list = [1, 2, 1, 4, 5, 6, 2]
     a = set(a_list)
     a
      
@@ -55,7 +55,7 @@
 p10 is the set of prime numbers from 1 to 10.
 
 Various operations that we do on sets are possible here also.
-The | character stands for union
+The | (pipe) character stands for union
 ::
 
     f10 | p10
@@ -89,19 +89,19 @@
     b = set([1, 2])
     b < f10
 
-gives a True since b is a proper subset of f10.
+gives a ``True`` since b is a proper subset of f10.
 Similarly,
 ::
 
     f10 < f10
 
-gives a False since f10 is not a proper subset.
+gives a ``False`` since f10 is not a proper subset.
 hence the right way to do would be
 ::
 
     f10 <= f10
 
-and we get a True since every set is a subset of itself.
+and we get a ``True`` since every set is a subset of itself.
 
 Sets can be iterated upon just like lists and tuples. 
 ::
@@ -122,7 +122,7 @@
     1 in f10
     2 in f10
 
-prints True and False respectively
+prints ``True`` and ``False`` respectively
 
 The order in which elements are organised in a set is not to be relied upon 
 since sets do not support indexing. Hence, slicing and striding are not valid
@@ -161,7 +161,6 @@
 
 {{{ Show the "sponsored by FOSSEE" slide }}}
 
-#[Nishanth]: Will add this line after all of us fix on one.
 This tutorial was created as a part of FOSSEE project, NME ICT, MHRD India
 
 Hope you have enjoyed and found it useful.
--- a/sets/slides.org	Tue Nov 09 23:26:39 2010 +0530
+++ b/sets/slides.org	Wed Nov 10 02:12:09 2010 +0530
@@ -43,8 +43,10 @@
     for mark in marks_set:
         marks.remove(mark)
     
-    # we are now left with only duplicates in the list marks
+    # we are now left with only duplicates
+    # in the list marks
     duplicates = set(marks)
+        
   #+end_src
 * Summary
   You should now be able to --
--- a/sets/slides.tex	Tue Nov 09 23:26:39 2010 +0530
+++ b/sets/slides.tex	Wed Nov 10 02:12:09 2010 +0530
@@ -1,4 +1,4 @@
-% Created 2010-10-10 Sun 23:53
+% Created 2010-11-09 Tue 17:14
 \documentclass[presentation]{beamer}
 \usepackage[latin1]{inputenc}
 \usepackage[T1]{fontenc}
@@ -67,7 +67,8 @@
 for mark in marks_set:
     marks.remove(mark)
 
-# we are now left with only duplicates in the list marks
+# we are now left with only duplicates
+# in the list marks
 duplicates = set(marks)
 \end{lstlisting}
 \end{frame}
--- a/tuples/questions.rst	Tue Nov 09 23:26:39 2010 +0530
+++ b/tuples/questions.rst	Wed Nov 10 02:12:09 2010 +0530
@@ -58,3 +58,10 @@
 
     Answer: (6, 5, 4, 3, 2, 1)
 
+ 10. What is the output of the code block below::
+
+       a = "hello", "bye", "welcome", "goodnight"
+       type(a)
+
+    Answer: <type 'tuple'>
+
--- a/tuples/script.rst	Tue Nov 09 23:26:39 2010 +0530
+++ b/tuples/script.rst	Wed Nov 10 02:12:09 2010 +0530
@@ -1,15 +1,10 @@
 .. Objectives
 .. ----------
 
-.. A - Students and teachers from Science and engineering backgrounds
-   B - Will learn what are tuples and why they are needed
-       Will learn the various methods of accessing elements in tuples
-   C - 
-   D - 
-
-.. #. what are tuples
-.. #. comparison with lists
-.. #. why are they needed
+.. At the end of the tutorial, you will
+.. #. have a clear understand of what tuples are
+.. #. be able to compare them with lists
+.. #. know why they are needed and where to use them 
 
 
 .. Prerequisites
@@ -25,7 +20,8 @@
 Script
 ------
 
-Hello friends and welcome to the tutorial on Tuples
+Hello friends and welcome to the tutorial on getting started with
+tuples. 
 
 {{{ Show the slide containing title }}}
 
@@ -37,9 +33,10 @@
  * their similarities and dissimilarities with lists
  * why are they needed
 
-Let`s get started by defining a tuple. A tuple is defined by enclosing
-parantheses around a sequence of items seperated by commas. It is similar to
-defining a list except that parantheses are used instead of square brackets.
+Let's get started by defining a tuple. A tuple is defined by enclosing
+parentheses around a sequence of items seperated by commas. It is
+similar to defining a list except that parentheses are used instead of
+square brackets.  
 ::
 
     t = (1, 2.5, "hello", -4, "world", 1.24, 5)
@@ -66,10 +63,10 @@
     t[2] = "Hello"
 
 We can see that, it raises an error saying tuple does not support item
-assignment. It only implies that tuples are immutable or in simple words,
-tuples cannot be changed.
+assignment. Tuples are immutable, and cannot be changed after
+creation. 
 
-But what is the use of tuples!!!
+Then, what's the use of tuples?
 
 We shall understand that soon. But let us look at a simple problem of swapping
 values.
@@ -110,8 +107,9 @@
     a
     b
 
-We see that the values are swapped.
-This idiom works for different datatypes also.
+We see that the values are swapped.  This idiom works for different
+data-types also.  
+
 ::
 
     a = 2.5
@@ -120,8 +118,8 @@
     a
     b
 
-Moreover this type of behaviour is straight forward and what you would expect
-should happen naturally.
+Moreover this type of behaviour is something that feels natural and
+you'd expect to happen. 
 
 This is possible because of the immutability of tuples. This process is called
 tuple packing and unpacking.
@@ -136,10 +134,10 @@
 
     5, "hello", 2.5
 
-Now it is a tuple with two elements.
+Now it is a tuple with three elements.
 
 So when we are actually typing two or more elements seperated by commas, those
-elements are packed and a tuple is made from them.
+elements are packed into a tuple. 
 
 When you type
 ::
@@ -165,9 +163,8 @@
 
 {{{ Show the "sponsored by FOSSEE" slide }}}
 
-#[Nishanth]: Will add this line after all of us fix on one.
 This tutorial was created as a part of FOSSEE project, NME ICT, MHRD India
 
 Hope you have enjoyed and found it useful.
-Thankyou
+Thank you