summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNishanth Amuluru2010-10-18 21:11:34 +0530
committerNishanth Amuluru2010-10-18 21:11:34 +0530
commit5ff51d25821b168672247194a8ba9ce5e62d88f2 (patch)
tree1f41ee7de294b91e2673b96a9a2cffa433e8e139
parente029f60f1a5254f12b32a62e9a00947dcfc16aa5 (diff)
parent53be576ae08a5ebe40d268f34b33229739396155 (diff)
downloadst-scripts-5ff51d25821b168672247194a8ba9ce5e62d88f2.tar.gz
st-scripts-5ff51d25821b168672247194a8ba9ce5e62d88f2.tar.bz2
st-scripts-5ff51d25821b168672247194a8ba9ce5e62d88f2.zip
Merged
-rw-r--r--basic-data-type/quickref.tex49
-rw-r--r--basic-data-type/script.rst (renamed from basicdatatype.rst)90
-rw-r--r--basic-data-type/slides.org72
-rw-r--r--basic-data-type/slides.tex158
-rw-r--r--conditionals/quickref.tex8
-rw-r--r--conditionals/script.rst (renamed from conditionals.rst)32
-rw-r--r--conditionals/slides.org123
-rw-r--r--conditionals/slides.tex106
-rw-r--r--dictionaries/script.rst37
-rw-r--r--getting-started-sagenotebook/quickref.tex8
-rw-r--r--getting-started-sagenotebook/script.rst (renamed from getting-started-sagenotebook.rst)38
-rw-r--r--getting-started-sagenotebook/slides.org123
-rw-r--r--getting-started-sagenotebook/slides.tex106
-rw-r--r--getting-started-strings/quickref.tex8
-rw-r--r--getting-started-strings/script.rst (renamed from getting-started-strings.rst)38
-rw-r--r--getting-started-strings/slides.org123
-rw-r--r--getting-started-strings/slides.tex106
-rw-r--r--getting-started-with-arrays/script.rst216
-rw-r--r--getting-started-with-for/script.rst72
-rw-r--r--getting-started-with-for/slides.org146
-rw-r--r--getting-started-with-for/slides.tex285
-rw-r--r--getting-started-with-lists/getting_started_with_lists.rst137
-rw-r--r--getting-started-with-lists/quickref.tex8
-rw-r--r--getting-started-with-lists/slides.org35
-rw-r--r--getting-started-with-lists/slides.tex106
-rw-r--r--manipulating-lists/quickref.tex8
-rw-r--r--manipulating-lists/script.rst (renamed from manipulating-lists.rst)32
-rw-r--r--manipulating-lists/slides.org123
-rw-r--r--manipulating-lists/slides.tex106
-rw-r--r--matrices/script.rst68
-rw-r--r--matrices/slides.org176
-rw-r--r--matrices/slides.tex357
-rw-r--r--multiple-plots/script.rst (renamed from multiple-plots.rst)35
-rw-r--r--multiple-plots/slides.org123
-rw-r--r--multiple-plots/slides.tex106
-rw-r--r--other-type-of-plots/script.rst71
-rw-r--r--other-type-of-plots/slides.org137
-rw-r--r--other-type-of-plots/slides.tex280
-rw-r--r--plotting-data/plotting-data.rst136
-rw-r--r--plotting-data/slides.org84
-rw-r--r--plotui/quickref.tex8
-rw-r--r--plotui/script.rst182
-rw-r--r--plotui/slides.tex106
-rw-r--r--progress.org110
-rw-r--r--savefig/script.rst32
-rw-r--r--statistics/quickref.tex8
-rw-r--r--statistics/script.rst (renamed from statistics.rst)21
-rw-r--r--statistics/slides.org33
-rw-r--r--statistics/slides.tex106
-rw-r--r--symbolics/quickref.tex8
-rw-r--r--symbolics/script.rst (renamed from symbolics.rst)6
-rw-r--r--symbolics/slides.tex106
-rw-r--r--using python modules/script.rst80
-rw-r--r--using python modules/slides.org125
-rw-r--r--using python modules/slides.tex227
-rw-r--r--using-sage/script.rst33
-rw-r--r--using-sage/slides.org60
-rw-r--r--using-sage/slides.tex139
58 files changed, 5073 insertions, 389 deletions
diff --git a/basic-data-type/quickref.tex b/basic-data-type/quickref.tex
new file mode 100644
index 0000000..1047219
--- /dev/null
+++ b/basic-data-type/quickref.tex
@@ -0,0 +1,49 @@
+\documentclass{article}
+\begin{Document}
+\begin{center}
+\textbf{Basic DataType Quick Reference}\\
+\end{center}
+Declaring an Integer:\\
+{\ex \lstinline| b=9999999999999999999 |}
+
+Declaring a float:\\
+{\ex \lstinline| p=3.141592 |}
+
+Declaring a Complex number:\\
+{\ex \lstinline| c = 3.2+4.6j |}
+
+Modulo Operator:\\
+{\ex \lstinline| 87 % 6 |}
+
+Exponent Operator:\\
+{\ex \lstinline| 7**8 |}
+
+Declaring a list:\\
+{\ex \lstinline| var_list = [1, 1.2, [1,2]] |}
+
+Declaring a string:\\
+{\ex \lstinline| k='Single quote' |}
+{\ex \lstinline| l="Double quote contain's single quote" |}
+{\ex \lstinline| m='''"Contain's both"''' |}
+
+Declaring a tuple:\\
+{\ex \lstinline| var_tup = (1,2,3,4) |}
+
+
+Accessing Lists, string and tuples:\\
+{\ex \lstinline| seq[-1] |}
+
+Interconversion of number datatype:\\
+{\ex \lstinline| float(2.3+4.2j) |}
+
+
+Interconversion of sequences:\\
+{\ex \lstinline| tup=tuple([1,2,3,4,5]) |}
+
+Spliting string into lists:\\
+{\ex \lstinline| ''split this sting''.split() |}
+
+Join lists to create strings:\\
+{\ex \lstinline| ','.join['List','joined','on','commas'] |}
+
+\end{Document}
diff --git a/basicdatatype.rst b/basic-data-type/script.rst
index ed97c24..64583c7 100644
--- a/basicdatatype.rst
+++ b/basic-data-type/script.rst
@@ -1,14 +1,29 @@
-Hello friends and welcome to the tutorial on Basic Data types and
-operators in Python.
+.. Objectives
+.. ----------
+
+.. Learn about Python Data Structures and Operators.(Remembering)
+.. Use them to do basic operations.(Applying)
+
+.. Prerequisites
+.. -------------
+
+
+
+.. Author : Amit Sethi
+ Internal Reviewer :
+ External Reviewer :
+ Checklist OK? : <put date stamp here, if OK> [2010-10-05]
+Hello friends and welcome to the tutorial on Basic Data types and operators in Python.
{{{ Show the slide containing title }}}
{{{ Show the slide containing the outline slide }}}
In this tutorial, we shall look at::
- * Various Datatypes in Python
- * Operators with a little hands-on on how they can be applied to
- the different data types.
+ * Datatypes in Python
+ * Operators in Python
+
+with a little hands-on on how they can be applied to the different data types.
@@ -20,8 +35,8 @@ There are three built-in data types in python to represent numbers.
These are:
* Integers
- * Complex and
- * Boolean
+ * float and
+ * Complex
Lets first talk about integers. ::
@@ -81,7 +96,7 @@ The last data type in the list is complex number ::
c = 3.2+4.6j
as simple as that so essentialy its just a combination of two floats the
-imaginary part being define by j notation instead of i. Complex numbers have a lot of functions specific to them.
+imaginary part being defined by j notation instead of i. Complex numbers have a lot of functions specific to them.
Lets check these ::
c.<Tab>
@@ -97,6 +112,10 @@ We can get the absolute value using the function ::
abs(c)
+
+
+{{ Slide for memory aid }}
+
Python also has Boolean as a built-in type.
Try it out just type ::
@@ -142,10 +161,42 @@ where as the expression ::
gives the value False.
-Lets now discuss sequence data structures in python. Sequence
+
+Lets now look at some operators available in Python to manipulate these data types.
+
+
+
+Python uses % for modulo operation ::
+
+ 87 % 6
+and two stars for a exponent. ::
+
+ 7**8
+
+
+In case one wishes to use the current value of variable in which the result is stored in the expression one can do that by putting the operator before `equal to`. ::
+
+ a=73
+ a*=34
+
+is same as ::
+
+ a=a*34
+
+and ::
+
+ a/=23
+
+is same as ::
+
+ a=a/23
+
+
+Lets now discuss sequence data stypes in python. Sequence
datatypes are those in which elements are kept in a sequential
order. All the elements accessed using index.
+
{{{ slide to for memory aid }}}
The sequence datatypes in python are ::
@@ -207,7 +258,7 @@ unlike '[' for lists.::
Because of their sequential property there are certain functions and
operations we can apply to all of them.
-{{{ Slide for memory aid }}}
+
The first one is accessing.
@@ -382,6 +433,21 @@ Thus we get a list joined on commas. Similarly we can do spaces.::
Note that the list has to be a list of strings to apply join operation.
+With this we come to the end of this tutorial .
+
+In this tutorial we have discussed
+
+1. Number Datatypes , integer,float and complex
+2. Boolean and datatype and operators
+3. Sequence data types ,List,String and Tuple
+4. Accesing sequence
+5. Slicing sequences
+6. Finding length , sorting and reversing operations on sequences.
+7. Immutability.
+
+
+
+
.. #[Nishanth]: string to list is fine. But list to string can be left for
string manipulations. Just say it requires some string
manipulations and leave it there.
@@ -399,7 +465,3 @@ Thank You.
-Author : Amit Sethi
-Internal Reviewer 1 : Nishanth
-Internal Reviewer 2 :
-External Reviewer
diff --git a/basic-data-type/slides.org b/basic-data-type/slides.org
new file mode 100644
index 0000000..2d12dbd
--- /dev/null
+++ b/basic-data-type/slides.org
@@ -0,0 +1,72 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\useoutertheme{infolines}\usecolortheme{default}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+#+OPTIONS: H:5 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
+
+#+TITLE: Plotting Data
+#+AUTHOR: FOSSEE
+#+DATE: 2010-09-14 Tue
+#+EMAIL: info@fossee.in
+
+# \author[FOSSEE] {FOSSEE}
+
+# \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
+# \date{}
+
+* Tutorial Plan
+** Datatypes in Python
+** Operators in Python
+
+* Numbers
+** Integers
+** Float
+** Complex
+
+* Boolean
+** True
+** False
+
+* Sequence Data types
+** Data in Sequence
+** Accessed using Index
+*** list
+*** String
+*** Tuple
+
+* All are Strings
+
+** k='Single quote'
+** l="Double quote contain's single quote"
+** m='''"Contain's both"'''
+
+* Summary
+** a=73
+** b=3.14
+** c=3+4j
+
+* Summary Contd.
+
+** t=True
+** f=False
+** t and f
+
+* Summary Contd.
+** l= [2,1,4,3]
+** s='hello'
+** tu=(1,2,3,4)
+
+* Summary Contd.
+** tu[-1]
+** s[1:-1]
+
+* Summary Contd.
+
+** Sorted(l)
+** reversed(s)
+
+
+
diff --git a/basic-data-type/slides.tex b/basic-data-type/slides.tex
new file mode 100644
index 0000000..b66f55d
--- /dev/null
+++ b/basic-data-type/slides.tex
@@ -0,0 +1,158 @@
+% Created 2010-10-13 Wed 17:08
+\documentclass[presentation]{beamer}
+\usetheme{Warsaw}\useoutertheme{infolines}\usecolortheme{default}\setbeamercovered{transparent}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{graphicx}
+\usepackage{longtable}
+\usepackage{float}
+\usepackage{wrapfig}
+\usepackage{soul}
+\usepackage{amssymb}
+\usepackage{hyperref}
+
+
+\title{Plotting Data }
+\author{FOSSEE}
+\date{2010-09-14 Tue}
+
+\begin{document}
+
+\maketitle
+
+
+
+
+
+
+\begin{frame}
+\frametitle{Tutorial Plan}
+\label{sec-1}
+\begin{itemize}
+
+\item Datatypes in Python\\
+\label{sec-1.1}%
+\item Operators in Python\\
+\label{sec-1.2}%
+\end{itemize} % ends low level
+\end{frame}
+\begin{frame}
+\frametitle{Numbers}
+\label{sec-2}
+\begin{itemize}
+
+\item Integers\\
+\label{sec-2.1}%
+\item Float\\
+\label{sec-2.2}%
+\item Complex\\
+\label{sec-2.3}%
+\end{itemize} % ends low level
+\end{frame}
+\begin{frame}
+\frametitle{Boolean}
+\label{sec-3}
+\begin{itemize}
+
+\item True\\
+\label{sec-3.1}%
+\item False\\
+\label{sec-3.2}%
+\end{itemize} % ends low level
+\end{frame}
+\begin{frame}
+\frametitle{Sequence Data types}
+\label{sec-4}
+\begin{itemize}
+
+\item Data in Sequence\\
+\label{sec-4.1}%
+\item Accessed using Index
+\label{sec-4.2}%
+\begin{itemize}
+
+\item list\\
+\label{sec-4.2.1}%
+\item String\\
+\label{sec-4.2.2}%
+\item Tuple\\
+\label{sec-4.2.3}%
+\end{itemize} % ends low level
+\end{itemize} % ends low level
+\end{frame}
+\begin{frame}
+\frametitle{All are Strings}
+\label{sec-5}
+\begin{itemize}
+
+\item k='Single quote'\\
+\label{sec-5.1}%
+\item l="Double quote contain's single quote"\\
+\label{sec-5.2}%
+\item m='''"Contain's both"'''\\
+\label{sec-5.3}%
+\end{itemize} % ends low level
+\end{frame}
+\begin{frame}
+\frametitle{Summary}
+\label{sec-6}
+\begin{itemize}
+
+\item a=73\\
+\label{sec-6.1}%
+\item b=3.14\\
+\label{sec-6.2}%
+\item c=3+4j\\
+\label{sec-6.3}%
+\end{itemize} % ends low level
+\end{frame}
+\begin{frame}
+\frametitle{Summary Contd.}
+\label{sec-7}
+\begin{itemize}
+
+\item t=True\\
+\label{sec-7.1}%
+\item f=False\\
+\label{sec-7.2}%
+\item t and f\\
+\label{sec-7.3}%
+\end{itemize} % ends low level
+\end{frame}
+\begin{frame}
+\frametitle{Summary Contd.}
+\label{sec-8}
+\begin{itemize}
+
+\item l= [2,1,4,3]\\
+\label{sec-8.1}%
+\item s='hello'\\
+\label{sec-8.2}%
+\item tu=(1,2,3,4)\\
+\label{sec-8.3}%
+\end{itemize} % ends low level
+\end{frame}
+\begin{frame}
+\frametitle{Summary Contd.}
+\label{sec-9}
+\begin{itemize}
+
+\item tu[-1]\\
+\label{sec-9.1}%
+\item s[1:-1]\\
+\label{sec-9.2}%
+\end{itemize} % ends low level
+\end{frame}
+\begin{frame}
+\frametitle{Summary Contd.}
+\label{sec-10}
+\begin{itemize}
+
+\item Sorted(l)\\
+\label{sec-10.1}%
+\item reversed(s)\\
+\label{sec-10.2}%
+\end{itemize} % ends low level
+\end{frame}
+
+\end{document}
diff --git a/conditionals/quickref.tex b/conditionals/quickref.tex
new file mode 100644
index 0000000..b26d168
--- /dev/null
+++ b/conditionals/quickref.tex
@@ -0,0 +1,8 @@
+Creating a linear array:\\
+{\ex \lstinline| x = linspace(0, 2*pi, 50)|}
+
+Plotting two variables:\\
+{\ex \lstinline| plot(x, sin(x))|}
+
+Plotting two lists of equal length x, y:\\
+{\ex \lstinline| plot(x, y)|}
diff --git a/conditionals.rst b/conditionals/script.rst
index 1092c79..980927f 100644
--- a/conditionals.rst
+++ b/conditionals/script.rst
@@ -1,8 +1,29 @@
-Hello friends. Welcome to this spoken tutorial on Getting started with
-strings.
+.. Objectives
+.. ----------
+
+.. Clearly state the objectives of the LO (along with RBT level)
+
+.. Prerequisites
+.. -------------
+
+.. 1. Name of LO-1
+.. 2. Name of LO-2
+.. 3. Name of LO-3
+
+.. Author : Madhu
+ Internal Reviewer :
+ External Reviewer :
+ Checklist OK? : <put date stamp here, if OK> [2010-10-05]
+
+
+Script
+------
{{{ Show the slide containing the title }}}
+Hello friends. Welcome to this spoken tutorial on Getting started with
+strings.
+
{{{ Show the slide containing the outline }}}
In this tutorial, we will learn the basic conditional constructs
@@ -167,10 +188,5 @@ statements in Python. In this tutorial session we learnt
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!
-.. Author : Madhu
- Internal Reviewer 1 : [potential reviewer: Puneeth]
- Internal Reviewer 2 : [potential reviewer: Anoop]
- External Reviewer :
-
diff --git a/conditionals/slides.org b/conditionals/slides.org
new file mode 100644
index 0000000..5d2ce93
--- /dev/null
+++ b/conditionals/slides.org
@@ -0,0 +1,123 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+
+#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
+#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
+
+#+LaTeX_HEADER: \usepackage{listings}
+
+#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
+#+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
+#+LaTeX_HEADER: showstringspaces=false, keywordstyle=\color{blue}\bfseries}
+
+#+TITLE: Accessing parts of arrays
+#+AUTHOR: FOSSEE
+#+EMAIL:
+#+DATE:
+
+#+DESCRIPTION:
+#+KEYWORDS:
+#+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
+
+* 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
+* Question 1
+ Change the last column of ~C~ to zeroes.
+* Solution 1
+ #+begin_src python
+ In []: C[:, -1] = 0
+ #+end_src
+* Question 2
+ Change ~A~ to ~[11, 12, 13, 14, 15]~.
+* 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
+* Question 3
+ - obtain ~[22, 23]~ from ~C~.
+ - obtain ~[11, 21, 31, 41]~ from ~C~.
+ - obtain ~[21, 31, 41, 0]~.
+* 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
+ #+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
+
+* 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.
+* Thank you!
+#+begin_latex
+ \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_latex
+
+
diff --git a/conditionals/slides.tex b/conditionals/slides.tex
new file mode 100644
index 0000000..df1462c
--- /dev/null
+++ b/conditionals/slides.tex
@@ -0,0 +1,106 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%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}
+\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{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}
+\date{}
+
+% DOCUMENT STARTS
+\begin{document}
+
+\begin{frame}
+ \maketitle
+\end{frame}
+
+\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}
+\end{frame}
+
+\end{document}
diff --git a/dictionaries/script.rst b/dictionaries/script.rst
index 31bc98e..1f5d102 100644
--- a/dictionaries/script.rst
+++ b/dictionaries/script.rst
@@ -1,11 +1,27 @@
-.. 8.4 LO: dictionaries (2)
-.. ------------------------
-.. * empty
-.. * filled
-.. * accessing via keys
-.. * .values(), .keys()
-.. * in
-.. * iteration
+.. Objectives
+.. ----------
+
+.. At the end of this tutorial, you will be able to
+
+.. 1. Create dictionaries
+.. #. Add data to dictionaries
+.. #. Retrieve data
+.. #. Familiarize using ``.keys()`` and ``.values()`` methods
+.. #. Checking for container-ship of keys
+.. #. Iterating over elements
+
+.. Prerequisites
+.. -------------
+
+.. 1. should have ``ipython`` installed.
+.. #. getting started with ``ipython``.
+.. #. basic datatypes.
+
+.. Author : Anoop Jacob Thomas <anoop@fossee.in>
+ Internal Reviewer :
+ External Reviewer :
+ Checklist OK? : <put date stamp here, if OK> [2010-10-05]
+
============
Dictionaries
@@ -176,8 +192,3 @@ iterating over the dictionaries.
{{{ switch to next slide, thank you slide }}}
Thank you!
-
-.. Author: Anoop Jacob Thomas <anoop@fossee.in>
- Reviewer 1:
- Reviewer 2:
- External reviewer:
diff --git a/getting-started-sagenotebook/quickref.tex b/getting-started-sagenotebook/quickref.tex
new file mode 100644
index 0000000..b26d168
--- /dev/null
+++ b/getting-started-sagenotebook/quickref.tex
@@ -0,0 +1,8 @@
+Creating a linear array:\\
+{\ex \lstinline| x = linspace(0, 2*pi, 50)|}
+
+Plotting two variables:\\
+{\ex \lstinline| plot(x, sin(x))|}
+
+Plotting two lists of equal length x, y:\\
+{\ex \lstinline| plot(x, y)|}
diff --git a/getting-started-sagenotebook.rst b/getting-started-sagenotebook/script.rst
index 629f58b..29a2c22 100644
--- a/getting-started-sagenotebook.rst
+++ b/getting-started-sagenotebook/script.rst
@@ -1,3 +1,35 @@
+.. Objectives
+.. ----------
+
+.. Clearly state the objectives of the LO (along with RBT level)
+
+.. By the end of this tutorial, you should --
+
+.. #. Know what Sage and Sage notebook are.
+.. #. Be able to start a Sage shell or notebook
+.. #. Be able to start using the notebook
+.. #. Be able to create new worksheets
+.. #. Know about the menu options available
+.. #. Know about the cells in the worksheet
+.. #. Be able to evaluate cells, create and delete cells, navigate them.
+.. #. Be able to make annotations in the worksheet
+.. #. Be able to use tab completion.
+.. #. Be able to use code from other languages in the cells.
+
+.. Prerequisites
+.. -------------
+
+.. None.
+
+.. Author : Madhu
+ Internal Reviewer :
+ External Reviewer :
+ Checklist OK? : <put date stamp here, if OK> [2010-10-05]
+
+
+Script
+------
+
Hello friends. Welcome to this spoken tutorial on Getting started with
sage and sage notebook.
@@ -286,10 +318,6 @@ learnt. In this session we learnt
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!
-.. Author : Madhu
- Internal Reviewer 1 : [potential reviewer: Anoop]
- Internal Reviewer 2 : [potential reviewer: Puneeth]
- External Reviewer :
diff --git a/getting-started-sagenotebook/slides.org b/getting-started-sagenotebook/slides.org
new file mode 100644
index 0000000..5d2ce93
--- /dev/null
+++ b/getting-started-sagenotebook/slides.org
@@ -0,0 +1,123 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+
+#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
+#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
+
+#+LaTeX_HEADER: \usepackage{listings}
+
+#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
+#+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
+#+LaTeX_HEADER: showstringspaces=false, keywordstyle=\color{blue}\bfseries}
+
+#+TITLE: Accessing parts of arrays
+#+AUTHOR: FOSSEE
+#+EMAIL:
+#+DATE:
+
+#+DESCRIPTION:
+#+KEYWORDS:
+#+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
+
+* 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
+* Question 1
+ Change the last column of ~C~ to zeroes.
+* Solution 1
+ #+begin_src python
+ In []: C[:, -1] = 0
+ #+end_src
+* Question 2
+ Change ~A~ to ~[11, 12, 13, 14, 15]~.
+* 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
+* Question 3
+ - obtain ~[22, 23]~ from ~C~.
+ - obtain ~[11, 21, 31, 41]~ from ~C~.
+ - obtain ~[21, 31, 41, 0]~.
+* 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
+ #+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
+
+* 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.
+* Thank you!
+#+begin_latex
+ \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_latex
+
+
diff --git a/getting-started-sagenotebook/slides.tex b/getting-started-sagenotebook/slides.tex
new file mode 100644
index 0000000..df1462c
--- /dev/null
+++ b/getting-started-sagenotebook/slides.tex
@@ -0,0 +1,106 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%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}
+\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{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}
+\date{}
+
+% DOCUMENT STARTS
+\begin{document}
+
+\begin{frame}
+ \maketitle
+\end{frame}
+
+\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}
+\end{frame}
+
+\end{document}
diff --git a/getting-started-strings/quickref.tex b/getting-started-strings/quickref.tex
new file mode 100644
index 0000000..b26d168
--- /dev/null
+++ b/getting-started-strings/quickref.tex
@@ -0,0 +1,8 @@
+Creating a linear array:\\
+{\ex \lstinline| x = linspace(0, 2*pi, 50)|}
+
+Plotting two variables:\\
+{\ex \lstinline| plot(x, sin(x))|}
+
+Plotting two lists of equal length x, y:\\
+{\ex \lstinline| plot(x, y)|}
diff --git a/getting-started-strings.rst b/getting-started-strings/script.rst
index 132172f..a03ee02 100644
--- a/getting-started-strings.rst
+++ b/getting-started-strings/script.rst
@@ -1,8 +1,33 @@
-Hello friends. Welcome to this spoken tutorial on Getting started with
-strings.
+.. Objectives
+.. ----------
+
+.. At the end of this tutorial, you should know --
+
+.. 1. How to define strings
+.. #. Different ways of defining a string
+.. #. How to concatenate strings
+.. #. How to print a string repeatedly
+.. #. Accessing individual elements of the string
+.. #. Immutability of strings
+
+.. Prerequisites
+.. -------------
+
+.. 1. getting started with ipython
+
+.. Author : Madhu
+ Internal Reviewer :
+ External Reviewer :
+ Checklist OK? : <put date stamp here, if OK> [2010-10-05]
+
+Script
+------
{{{ Show the slide containing the title }}}
+Hello friends. Welcome to this spoken tutorial on Getting started with
+strings.
+
{{{ Show the slide containing the outline }}}
In this tutorial, we will learn what do we actually mean by strings in
@@ -106,7 +131,7 @@ 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
+ * Different ways of defining a string
* String concatenation and repeatition
* Accessing individual elements of the string
* Immutability of strings
@@ -116,10 +141,5 @@ we learnt
This tutorial was created as a part of FOSSEE project, NME ICT, MHRD India
Hope you have enjoyed and found it useful.
-Thankyou
-
-.. Author : Madhu
- Internal Reviewer 1 : [potential reviewer: Nishanth]
- Internal Reviewer 2 : [potential reviewer: Amit]
- External Reviewer :
+Thank you!
diff --git a/getting-started-strings/slides.org b/getting-started-strings/slides.org
new file mode 100644
index 0000000..5d2ce93
--- /dev/null
+++ b/getting-started-strings/slides.org
@@ -0,0 +1,123 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+
+#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
+#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
+
+#+LaTeX_HEADER: \usepackage{listings}
+
+#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
+#+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
+#+LaTeX_HEADER: showstringspaces=false, keywordstyle=\color{blue}\bfseries}
+
+#+TITLE: Accessing parts of arrays
+#+AUTHOR: FOSSEE
+#+EMAIL:
+#+DATE:
+
+#+DESCRIPTION:
+#+KEYWORDS:
+#+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
+
+* 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
+* Question 1
+ Change the last column of ~C~ to zeroes.
+* Solution 1
+ #+begin_src python
+ In []: C[:, -1] = 0
+ #+end_src
+* Question 2
+ Change ~A~ to ~[11, 12, 13, 14, 15]~.
+* 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
+* Question 3
+ - obtain ~[22, 23]~ from ~C~.
+ - obtain ~[11, 21, 31, 41]~ from ~C~.
+ - obtain ~[21, 31, 41, 0]~.
+* 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
+ #+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
+
+* 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.
+* Thank you!
+#+begin_latex
+ \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_latex
+
+
diff --git a/getting-started-strings/slides.tex b/getting-started-strings/slides.tex
new file mode 100644
index 0000000..df1462c
--- /dev/null
+++ b/getting-started-strings/slides.tex
@@ -0,0 +1,106 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%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}
+\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{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}
+\date{}
+
+% DOCUMENT STARTS
+\begin{document}
+
+\begin{frame}
+ \maketitle
+\end{frame}
+
+\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}
+\end{frame}
+
+\end{document}
diff --git a/getting-started-with-arrays/script.rst b/getting-started-with-arrays/script.rst
index 6ef35a0..0889032 100644
--- a/getting-started-with-arrays/script.rst
+++ b/getting-started-with-arrays/script.rst
@@ -1,39 +1,60 @@
-.. 4.1 LO: getting started with arrays (2) [anoop]
-.. ------------------------------------------------
-.. * why arrays
-.. + speed - simply say
-.. + array level operations
-.. * creating arrays
-.. + direct data
-.. + list conversion
-.. + homogeneous
-.. + builtins - identitiy, zeros,
-.. * array operations
-.. + =+ - * /=
+.. Objectives
+.. ----------
+
+.. At the end of this tutorial, you will be able to
+
+.. 1. Create arrays using data
+.. #. Create arrays from lists
+.. #. Basic array operations
+.. #. Creating identity matrix using ``identity()`` function.
+.. #. Learn about ``zeros()``, ``zeros_like()``, ``ones()``,
+ ``ones_like()`` functions.
+
+.. Prerequisites
+.. -------------
+
+.. 1. should have ``ipython`` and ``pylab`` installed.
+.. #. getting started with ``ipython``.
+.. #. getting started with lists.
+
+.. Author: Anoop Jacob Thomas <anoop@fossee.in>
+ Internal Reviewer : Puneeth
+ External Reviewer :
+ Checklist OK? : <put date stamp here, if OK> [2010-10-05]
===========================
Getting started with Arrays
===========================
+.. #[Puneeth: Prerequisites and Objectives are missing. Fill them in]
+
{{{ show the welcome slide }}}
Welcome to the spoken tutorial on getting started with arrays.
{{{ switch to next slide, outline slide }}}
-In this tutorial, we will learn about arrays, how to convert a list
-into an array and also why an array is preferred over lists. And array
-operations.
+In this tutorial, we will learn about arrays, how to convert a list into an
+array and also why an array is preferred over lists. And array operations.
+
+.. #[Puneeth: Fix the grammar above.]
{{{ switch to next slide on overview of array }}}
-Arrays are homogeneous data structures, unlike lists, arrays cannot
-have heterogeneous data elements, that is, it can have only one type
-of data type, either all integers, or strings, or float, and not a
-mix.
+Arrays are homogeneous data structures, unlike lists, arrays cannot have
+heterogeneous data elements, that is, it can have only one type of data
+type, either all integers, or strings, or float, and not a mix.
+
+.. #[Puneeth: Use multiple short sentences, rather than one long sentence
+ I would've written something like this.
+
+ Unlike lists, arrays are homogeneous data structures. They can have only
+ type of data, ....]
+
+Arrays are really fast in mathematical operations when compared to lists,
+it is at least 80 to 100 times faster than lists.
-Arrays are really fast in mathematical operations when compared to
-lists, it is at least 80 to 100 times faster than lists.
+.. #[Puneeth: For what size of an array is that the comparison?
{{{ switch to the next slide, creating arrays }}}
@@ -42,39 +63,63 @@ Now let us see how to create arrays.
I am assuming that you have your IPython interpreter running with the
``-pylab`` option, so that you have the required modules loaded.
+.. #[Puneeth: 'I am assuming' doesn't sound right. Ask them to open if it
+.. is not open?]
+
To create an array we will use the function ``array()`` as,
+
::
a1 = array([1,2,3,4])
-Notice that here we created a one dimensional array. Also notice the
-object we passed to create an array. Now let us see how to create a
-two dimensional array. Pause here and try to do it yourself before
-looking at the solution.
+Notice that here we created a one dimensional array. Also notice the object
+we passed to create an array. Now let us see how to create a two
+dimensional array. Pause here and try to do it yourself before looking at
+the solution.
+
+.. #[Puneeth: I don't think this question can be solved by an average
+.. viewer. Questions during the tutorial, should generally be to re-iterate
+.. concepts learnt? ]
+
+.. #[Puneeth: Also, you didn't even point out that we are converting a
+.. list, using the ``array`` function. Bring the later section about
+.. converting a list, here. A separate section is not necessary, IMHO.]
This is how we create two dimensional arrays.
+
::
a2 = array([[1,2,3,4],[5,6,7,8]])
+.. #[Puneeth: Again, you could explain a bit about the fact that we are
+.. converting a list of lists.]
+
Let us see an easy method of creating an array with elements 1 to 8.
+
::
ar = arange(1,9)
+.. #[Puneeth: say, creating the same array as before. for some time I got
+.. confused .]
+
And it created a single dimensional array of elements from 1 to 8.
+
::
print ar
-And how can we make it a two dimensional array of order 2 by 4. Pause
-here and try to do it yourself, try ``ar.tab`` and find a suitable
-method for that.
+.. #[Puneeth: be consistent with voice. say, we obtained... or something.]
+
+And how can we make it a two dimensional array of order 2 by 4. Pause here
+and try to do it yourself, try ``ar.tab`` and find a suitable method for
+that.
{{{ switch to next slide, reshape() method }}}
-We can use the function ``reshape()`` for that purpose and it can be
-done as,
+We can use the function ``reshape()`` for that purpose and it can be done
+as,
+
::
ar.reshape(2,4)
@@ -84,14 +129,15 @@ done as,
{{{ switch to next slide, creating array from list}}}
Now, let us see how to convert a list object to an array. As you have
-already seen, in both of the previous statements we have passed a
-list, so creating an array can be done so, first let us create a list
-``l1``
+already seen, in both of the previous statements we have passed a list, so
+creating an array can be done so, first let us create a list ``l1``
+
::
l1 = [1,2,3,4]
-Now we can convert the list to an array as,
+Now we can convert the list to an array as,
+
::
a3 = array(l1)
@@ -101,70 +147,96 @@ Now we can convert the list to an array as,
Create a three dimensional array of the order (2,2,4).
+.. #[Puneeth: s/order/shape or size ?]
+
{{{ switch to the next slide, shape of an array }}}
To find the shape of an array we can use the object ``.shape``, let us
check the shape of the arrays we have created so far,
+
+.. #[Puneeth: s/object/method ?]
+
::
a1.shape
-``a1.shape`` object is a tuple, and since a1 is a single dimensional
-array, it returned a tuple (4,).
+``a1.shape`` object is a tuple, and since a1 is a single dimensional array,
+it returned a tuple (4,).
+
+.. #[Puneeth: first show a 2D array, so that it becomes easier to explain.
+.. Also, the word ``tuple`` need not be mentioned. ]
{{{ switch to the next slide, unsolved exercise 2 }}}
Find out the shape of the other arrays that we have created.
+.. #[Puneeth: solution missing.]
+
{{{ Array can have only a single type of data }}}
-Now let us try to create a new array with a mix of elements and see
-what will happen,
+.. #[Puneeth: I guess, this whole section can be skipped. If you want to
+.. keep this, just briefly mention that arrays are homogeneous in the
+.. intro, don't explain it there.]
+
+Now let us try to create a new array with a mix of elements and see what
+will happen,
+
::
a4 = array([1,2,3,'a string'])
-Well, we expected an error as previously I said that an array can have
-only homogeneous elements, but it didn't give an error. Let us check
-the values in the new array created. In your IPython terminal type,
+Well, we expected an error as previously I said that an array can have only
+homogeneous elements, but it didn't give an error. Let us check the values
+in the new array created. In your IPython terminal type,
::
a4
-Did you notice it,
+Did you notice it,
{{{ switch to next slide, implicit type casting }}}
-{{{ highlight all the array elements one by one using mouse
-movements }}}
+.. #[Puneeth: typecasting may be unnecessary. (Also too advanced?) an
+.. average guy wouldn't use arrays with strings.]
-all the elements have been implicitly type casted as string, though
-our first three elements were integers.
+.. #[Puneeth: You may want to mention that float is the default dtype.]
+
+{{{ highlight all the array elements one by one using mouse movements }}}
+
+all the elements have been implicitly type casted as string, though our
+first three elements were integers.
+
+.. #[Puneeth: when I type a4 it says some ``dtype`` etc. I don't understand
+.. what it is, can you explain? ;)]
{{{ switch to the next slide, identity & zeros methods }}}
-An identity matrix is a square matrix in which all the diagonal
-elements are one and rest of the elements zero. We can create an
-identity matrix using the method ``identity()``.
+.. #[Puneeth: something needs to motivate this. why are we suddenly talking
+.. of an identity matrix?]
+
+An identity matrix is a square matrix in which all the diagonal elements
+are one and rest of the elements zero. We can create an identity matrix
+using the method ``identity()``.
The function ``identity()`` takes an integer argument,
+
::
identity(3)
-As you can see the identity method returned a three by three square
-array with all the diagonal elements as one and the rest of the
-elements as zero.
+As you can see the identity method returned a three by three square array
+with all the diagonal elements as one and the rest of the elements as zero.
-``zeros()`` function accepts a tuple, which is the order of the array
-we want to create, and it generates an array with all elements zero.
+.. #[Puneeth: You say array here, matrix there -- it's a bit messed up.
+.. Clarify, explicitly.]
-{{{ switch to the next slide, problem statement of the solved exercise
-1 }}}
+``zeros()`` function accepts a tuple, which is the order of the array we
+want to create, and it generates an array with all elements zero.
-Let us creates an array of the order four by five with all the
-elements zero. We can do it using the method zeros,
-::
+{{{ switch to the next slide, problem statement of solved exercise 1 }}}
+
+Let us creates an array of the order four by five with all the elements
+zero. We can do it using the method zeros, ::
zeros((4,5))
@@ -216,8 +288,7 @@ Notice the change in elements of a,
a
-We can use all the mathematical operations with arrays, Now let us try
-this
+We can use all the mathematical operations with arrays, Now let us try this
::
a1 = array([1,2,3,4])
@@ -229,20 +300,25 @@ Returns an array with element by element addition,
a1 * a2
-Returns an array with element by element multiplication, notice that
-it does not perform matrix multiplication.
+Returns an array with element by element multiplication, notice that it
+does not perform matrix multiplication.
{{{ switch to next slide, summary slide }}}
-So this brings us to the end of this tutorial, in this tutorial we
-covered basics of arrays, how to create an array, converting a list to
-an array, basic array operations etc.
+So this brings us to the end of this tutorial, in this tutorial we covered
+basics of arrays, how to create an array, converting a list to an array,
+basic array operations etc.
+
+.. #[Puneeth: s/how to create an array/creating an array]
{{{ switch to next slide, thank you }}}
Thank you!
-.. Author: Anoop Jacob Thomas <anoop@fossee.in>
- Reviewer 1:
- Reviewer 2:
- External reviewer:
+..
+ Local Variables:
+ mode: rst
+ indent-tabs-mode: nil
+ sentence-end-double-space: nil
+ fill-column: 75
+ End:
diff --git a/getting-started-with-for/script.rst b/getting-started-with-for/script.rst
index ce6e26c..a8226fe 100644
--- a/getting-started-with-for/script.rst
+++ b/getting-started-with-for/script.rst
@@ -1,12 +1,29 @@
-.. 3.2 LO: getting started with =for= (2) [anoop]
-.. -----------------------------------------------
-.. * blocks in python
-.. + (indentation)
-.. * blocks in ipython
-.. + ... prompt
-.. + hitting enter
-.. * =for= with a list
-.. * =range= function
+.. Objectives
+.. ----------
+
+.. At the end of this tutorial, you will be able to
+
+.. 1. Write blocks of code in python.
+.. #. Use for loop.
+.. #. Use ``range()`` function.
+.. #. Write blocks in python interpreter
+.. #. Write blocks in ipython interpreter.
+
+
+.. Prerequisites
+.. -------------
+
+.. 1. should have ``ipython`` and ``pylab`` installed.
+.. #. getting started with ``ipython``.
+.. #. getting started with lists.
+
+
+.. Author : Anoop Jacob Thomas <anoop@fossee.in>
+ Internal Reviewer : Nishanth
+ Internal Reviewer(2): Amit
+ External Reviewer :
+ Checklist OK? : <put date stamp here, if OK> [2010-10-05]
+
=============================
Getting started with for loop
@@ -43,6 +60,11 @@ The best practice is to indent the code using four spaces.
for indentation. Do that while typing so that they can
actually see what is being typed.
+As you can see in the slide, ``Block B`` is an inner block and it is
+indented using 4 spaces, and after ``Block B`` the next statement in
+``Block A`` starts from the same indentation level of other ``Block
+A`` statements.
+
Now let us move straight into ``for`` loop.
{{{ switch to next slide, problem statement of exercise 1 }}}
@@ -85,6 +107,8 @@ following.
square_roots. It is only complicating stuff.
Simply iterate and print.
+{{{ switch to next slide, save and run script }}}
+
{{{ save the script }}}
Now save the script, and run it from your IPython interpreter. I
@@ -151,6 +175,8 @@ Now let us try a simple one, to print the square root of numbers in
the list. And this time let us do it right in the IPython
interpreter.
+{{{ switch to next slide, Indentation in ``ipython`` }}}
+
{{{ switch focus to the IPython interpreter }}}
So let us start with making a list. Type the following
@@ -166,11 +192,14 @@ dots. Please note that IPython automatically indents the block. The
four dots tell you that you are inside a block. Now type the rest of
the ``for`` loop,
+{{{ switch to next slide, Indentation in ``ipython`` (cont'd) }}}
+
.. #[Nishanth]: Tell that IPython does auto indentation.
::
- print "Square root of", each, "is", sqrt(each)
+ print "Square root of", each,
+ print "is", sqrt(each)
Now we have finished the statements in the block, and still the
interpreter is showing four dots, which means you are still inside the
@@ -178,6 +207,8 @@ block. To exit from the block press return key or the enter key twice
without entering anything else. It printed the square root of each
number in the list, and that is executed in a ``for`` loop.
+{{{ switch to next slide, Indentation in ``python`` interpreter }}}
+
Now, let us find the cube of all the numbers from one to ten. But this
time let us try it in the vanilla version of Python interpreter.
@@ -187,6 +218,9 @@ Start the vanilla version of Python interpreter by issuing the command
{{{ open the python interpreter in the terminal using the command
python to start the vanilla Python interpreter }}}
+{{{ switch to next slide, Indentation in ``python`` interpreter
+(cont'd) }}}
+
Start with,
::
@@ -214,6 +248,8 @@ block, hit enter once again
Then say this list can also be generated using
the range function and hence introduce range.
+{{{ switch to the next slide, ``range()`` function }}}
+
Okay! so the main thing here we learned is how to use Python
interpreter and IPython interpreter to specify blocks. But while we
were generating the multiplication table we used something new,
@@ -225,12 +261,14 @@ specify will not be included in the ``list``.
.. #[Nishanth]: Show some examples of range without the step argument
May be give an exercise with negative numbers as arguments
-Now, let us print all the odd numbers from 1 to 50. Let us do it in
-our IPython interpreter for ease of use.
-
{{{ switch to next slide, problem statement of the next problem in
solved exercises }}}
+Now, let us print all the odd numbers from 1 to 50. Pause here and try
+to solve the problem yourself.
+
+Let us do it in our IPython interpreter for ease of use.
+
{{{ switch focus to ipython interpreter }}}
The problem can be solved by just using the ``range()`` function.
@@ -248,7 +286,7 @@ the range. Note that the sequence doesn't include the ending
number. The third parameter is for stepping through the sequence. Here
we gave two which means we are skipping every alternate element.
-{{{ switch to next slide, recap slide }}}
+{{{ switch to next slide, summary slide }}}
Thus we come to the end of this tutorial. We learned about blocks in
Python, indentation, blocks in IPython, for loop, iterating over a
@@ -265,9 +303,3 @@ list and then the ``range()`` function.
{{{ switch to next slide, thank you slide }}}
Thank you!
-
-.. Author: Anoop Jacob Thomas <anoop@fossee.in>
- Reviewer 1: Nishanth
- Reviewer 2: Amit Sethi
- External reviewer:
-
diff --git a/getting-started-with-for/slides.org b/getting-started-with-for/slides.org
new file mode 100644
index 0000000..51cb7ab
--- /dev/null
+++ b/getting-started-with-for/slides.org
@@ -0,0 +1,146 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+
+#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
+#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
+
+#+LaTeX_HEADER: \usepackage{listings}
+
+#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
+#+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
+#+LaTeX_HEADER: showstringspaces=false, keywordstyle=\color{blue}\bfseries}
+
+#+TITLE: Getting started with for
+#+AUTHOR: FOSSEE
+#+EMAIL:
+#+DATE:
+
+#+DESCRIPTION:
+#+KEYWORDS:
+#+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
+
+* Outline
+ - ~for~ loop in Python.
+ - Blocks of code in Python.
+ - Indentation
+* Whitespace in Python
+ - Whitespace is significant
+ - blocks are visually separated
+ - Blocks are indented using 4 spaces
+ : Block A
+ : Block A
+ : Block B
+ : Block B
+ : Block A
+ ~Block B~ is an inner block and is indented using 4 spaces
+* Exercise 1
+ Write a ~for~ loop which iterates through a list of numbers and find
+ the square root of each number.
+ :
+ The numbers are,
+ : 1369, 7225, 3364, 7056, 5625, 729, 7056,
+ : 576, 2916
+* Solution 1
+ - Open text editor and type the following code
+ #+begin_src python
+ numbers = [1369, 7225, 3364, 7056, 5625, 729, 7056,
+ 576, 2916]
+
+ for each in numbers:
+ print "Square root of", each, "is", sqrt(each)
+
+ print "This is not in for loop!"
+ #+end_src
+* Save \& run script
+ - Save the script as ~list_roots.py~
+ - Run in ~ipython~ interpreter as,
+ : In []: %run -i list_roots.py
+* Exercise 2
+ From the given numbers make a list of perfect squares and a list of those which are not.
+ :
+ The numbers are,
+ : 7225, 3268, 3364, 2966, 7056, 5625, 729, 5547,
+ : 7056, 576, 2916
+* Exercise 3 (indentation in ~ipython~)
+ Print the square root of numbers in the list.
+ :
+ Numbers are,
+ : 7225, 3268, 3364, 2966, 7056, 5625, 729, 5547,
+ : 7056, 576, 2916
+* Indentation in ~ipython~
+ : In []: numbers = [1369, 7225, 3364, 7056, 5625,
+ : ...: 729, 7056, 576, 2916]
+
+ : In []: for each in numbers:
+ : ...:
+ Note the four spaces here
+ :
+ :
+ :
+ :
+ :
+ :
+* Indentation in ~ipython~ (cont'd)
+ : In []: numbers = [1369, 7225, 3364, 7056, 5625,
+ : ...: 729, 7056, 576, 2916]
+ : In []: for each in numbers:
+ : ...:
+ Note the four spaces here
+ :
+ Now type the rest of the code
+ : ...: print "Square root of", each,
+ : ...: print "is", sqrt(each)
+ : ...:
+ : ...:
+* Indentation in ~python~ interpreter
+ Find out the cube of all the numbers from 1 to 10.
+ :
+ /do it in the python interpreter/
+* Indentation in ~python~ interpreter (cont'd)
+ #+begin_src python
+ >>> for i in range(1, 11):
+ ... print i, "cube is", i**3
+ ...
+ #+end_src
+* ~range()~ function
+ - in built function in Python
+ - generates a list of integers
+ - /syntax:/ range([start,] stop[, step])
+ - /example:/
+ - range(1, 20) - /generates integers from 1 to 20/
+ - range(20) - /generates integers from 0 to 20/
+* Exercise 4
+ Print all the odd numbers from 1 to 50.
+* Summary
+ - blocks in ~python~
+ - indentation
+ - blocks in ~ipython~ interpreter
+ - ~for~ loop
+ - iterating over list using ~for~ loop
+ - ~range()~ function
+* Thank you!
+#+begin_latex
+ \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_latex
+
+
diff --git a/getting-started-with-for/slides.tex b/getting-started-with-for/slides.tex
new file mode 100644
index 0000000..f6c1eaa
--- /dev/null
+++ b/getting-started-with-for/slides.tex
@@ -0,0 +1,285 @@
+% Created 2010-10-12 Tue 12:55
+\documentclass[presentation]{beamer}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\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
+\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}}
+
+\title{Getting started with for}
+\author{FOSSEE}
+\date{}
+
+\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+\begin{document}
+
+\maketitle
+
+
+
+
+
+
+
+
+
+\begin{frame}
+\frametitle{Outline}
+\label{sec-1}
+
+\begin{itemize}
+\item \texttt{for} loop in Python.
+\item Blocks of code in Python.
+
+\begin{itemize}
+\item Indentation
+\end{itemize}
+
+\end{itemize}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Whitespace in Python}
+\label{sec-2}
+
+\begin{itemize}
+\item Whitespace is significant
+
+\begin{itemize}
+\item blocks are visually separated
+\end{itemize}
+
+\item Blocks are indented using 4 spaces
+\begin{verbatim}
+ Block A
+ Block A
+ Block B
+ Block B
+ Block A
+\end{verbatim}
+
+ \texttt{Block B} is an inner block and is indented using 4 spaces
+\end{itemize}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Exercise 1}
+\label{sec-3}
+
+ Write a \texttt{for} loop which iterates through a list of numbers and find
+ the square root of each number.
+\begin{verbatim}
+
+\end{verbatim}
+
+ The numbers are,
+\begin{verbatim}
+ 1369, 7225, 3364, 7056, 5625, 729, 7056,
+ 576, 2916
+\end{verbatim}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Solution 1}
+\label{sec-4}
+
+\begin{itemize}
+\item Open text editor and type the following code
+\end{itemize}
+
+\begin{verbatim}
+numbers = [1369, 7225, 3364, 7056, 5625, 729, 7056,
+ 576, 2916]
+
+for each in numbers:
+ print "Square root of", each, "is", sqrt(each)
+
+print "This is not in for loop!"
+\end{verbatim}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Save \& run script}
+\label{sec-5}
+
+\begin{itemize}
+\item Save the script as \texttt{list\_roots.py}
+\item Run in \texttt{ipython} interpreter as,
+\begin{verbatim}
+ In []: %run -i list_roots.py
+\end{verbatim}
+
+\end{itemize}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Exercise 2}
+\label{sec-6}
+
+ From the given numbers make a list of perfect squares and a list of those which are not.
+\begin{verbatim}
+
+\end{verbatim}
+
+ The numbers are,
+\begin{verbatim}
+ 7225, 3268, 3364, 2966, 7056, 5625, 729, 5547,
+ 7056, 576, 2916
+\end{verbatim}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Exercise 3 (indentation in \texttt{ipython})}
+\label{sec-7}
+
+ Print the square root of numbers in the list.
+\begin{verbatim}
+
+\end{verbatim}
+
+ Numbers are,
+\begin{verbatim}
+ 7225, 3268, 3364, 2966, 7056, 5625, 729, 5547,
+ 7056, 576, 2916
+\end{verbatim}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Indentation in \texttt{ipython}}
+\label{sec-8}
+
+\begin{verbatim}
+ In []: numbers = [1369, 7225, 3364, 7056, 5625,
+ ...: 729, 7056, 576, 2916]
+\end{verbatim}
+
+
+\begin{verbatim}
+ In []: for each in numbers:
+ ...:
+\end{verbatim}
+
+ Note the four spaces here
+\begin{verbatim}
+
+
+
+
+
+
+\end{verbatim}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Indentation in \texttt{ipython} (cont'd)}
+\label{sec-9}
+
+\begin{verbatim}
+ In []: numbers = [1369, 7225, 3364, 7056, 5625,
+ ...: 729, 7056, 576, 2916]
+ In []: for each in numbers:
+ ...:
+\end{verbatim}
+
+ Note the four spaces here
+\begin{verbatim}
+
+\end{verbatim}
+
+ Now type the rest of the code
+\begin{verbatim}
+ ...: print "Square root of", each,
+ ...: print "is", sqrt(each)
+ ...:
+ ...:
+\end{verbatim}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Indentation in \texttt{python} interpreter}
+\label{sec-10}
+
+ Find out the cube of all the numbers from 1 to 10.
+\begin{verbatim}
+
+\end{verbatim}
+
+ \emph{do it in the python interpreter}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Indentation in \texttt{python} interpreter (cont'd)}
+\label{sec-11}
+
+\begin{verbatim}
+>>> for i in range(1, 11):
+... print i, "cube is", i**3
+...
+\end{verbatim}
+\end{frame}
+\begin{frame}
+\frametitle{\texttt{range()} function}
+\label{sec-12}
+
+\begin{itemize}
+\item in built function in Python
+\item generates a list of integers
+
+\begin{itemize}
+\item \emph{syntax:} range([start,] stop[, step])
+\item \emph{example:}
+
+\begin{itemize}
+\item range(1, 20) - \emph{generates integers from 1 to 20}
+\item range(20) - \emph{generates integers from 0 to 20}
+\end{itemize}
+
+\end{itemize}
+
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{Exercise 4}
+\label{sec-13}
+
+ Print all the odd numbers from 1 to 50.
+\end{frame}
+\begin{frame}
+\frametitle{Summary}
+\label{sec-14}
+
+\begin{itemize}
+\item blocks in \texttt{python}
+\item indentation
+\item blocks in \texttt{ipython} interpreter
+\item \texttt{for} loop
+\item iterating over list using \texttt{for} loop
+\item \texttt{range()} function
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{Thank you!}
+\label{sec-15}
+
+ \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}
diff --git a/getting-started-with-lists/getting_started_with_lists.rst b/getting-started-with-lists/getting_started_with_lists.rst
new file mode 100644
index 0000000..a82de02
--- /dev/null
+++ b/getting-started-with-lists/getting_started_with_lists.rst
@@ -0,0 +1,137 @@
+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
+structure called lists. We will learn ::
+
+ * How to create lists
+ * Structure of lists
+ * Access list elements
+ * Append elements to lists
+ * Deleting 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.
+
+We will first create an empty list with no elements. On your IPython
+shell type ::
+
+ empty = []
+ type(empty)
+
+
+This is an empty list without any elements.
+
+* Filled lists
+
+Lets now define a list, nonempty and fill it with some random elements.
+
+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.
+
+
+
+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
+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 ::
+
+ 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. ::
+
+ nonempty[0]
+ nonempty[1]
+ nonempty[3]
+
+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.
+
+We can append elements to the end of a list using append command. ::
+
+ nonempty.append('onemore')
+ nonempty
+ nonempty.append(6)
+ nonempty
+
+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 ::
+
+ len(nonempty)
+
+
+
+Just like we can append elements to a list we can also remove them.
+There are two ways of doing it. One is by using index. ::
+
+ del(nonempty[1])
+
+
+
+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 ::
+
+ a.remove(100)
+
+but what if their were two 100's. To check that lets do a small
+experiment. ::
+
+ a.append('spam')
+ a
+ a.remove('spam')
+ a
+
+If we check a 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.
+
+
+{{{Slide for Summary }}}
+
+
+In this tutorial we came across a sequence data type called lists. ::
+
+ * We learned how to create lists.
+ * How to access lists.
+ * Append elements to list.
+ * Delete Element from list.
+ * And Checking list length.
+
+
+
+{{{ Sponsored by Fossee Slide }}}
+
+This tutorial was created as a part of FOSSEE project.
+
+I hope you found this tutorial useful.
+
+Thank You
+
+
+ * Author : Amit Sethi
+ * First Reviewer :
+ * Second Reviewer : Nishanth
diff --git a/getting-started-with-lists/quickref.tex b/getting-started-with-lists/quickref.tex
new file mode 100644
index 0000000..b26d168
--- /dev/null
+++ b/getting-started-with-lists/quickref.tex
@@ -0,0 +1,8 @@
+Creating a linear array:\\
+{\ex \lstinline| x = linspace(0, 2*pi, 50)|}
+
+Plotting two variables:\\
+{\ex \lstinline| plot(x, sin(x))|}
+
+Plotting two lists of equal length x, y:\\
+{\ex \lstinline| plot(x, y)|}
diff --git a/getting-started-with-lists/slides.org b/getting-started-with-lists/slides.org
new file mode 100644
index 0000000..528c840
--- /dev/null
+++ b/getting-started-with-lists/slides.org
@@ -0,0 +1,35 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\useoutertheme{infolines}\usecolortheme{default}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+#+OPTIONS: H:5 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
+
+#+TITLE: Plotting Data
+#+AUTHOR: FOSSEE
+#+DATE: 2010-09-14 Tue
+#+EMAIL: info@fossee.in
+
+# \author[FOSSEE] {FOSSEE}
+
+# \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
+# \date{}
+
+* Tutorial Plan
+** How to create lists
+** Structure of lists
+** Access list elements
+** Append elements to lists
+** Deleting elements from lists
+
+
+* Summary
+
+ l=[1,2,3,4]
+ l[-1]
+ l.append(5)
+ del(l[2])
+ len(l)
+
diff --git a/getting-started-with-lists/slides.tex b/getting-started-with-lists/slides.tex
new file mode 100644
index 0000000..df1462c
--- /dev/null
+++ b/getting-started-with-lists/slides.tex
@@ -0,0 +1,106 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%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}
+\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{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}
+\date{}
+
+% DOCUMENT STARTS
+\begin{document}
+
+\begin{frame}
+ \maketitle
+\end{frame}
+
+\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}
+\end{frame}
+
+\end{document}
diff --git a/manipulating-lists/quickref.tex b/manipulating-lists/quickref.tex
new file mode 100644
index 0000000..b26d168
--- /dev/null
+++ b/manipulating-lists/quickref.tex
@@ -0,0 +1,8 @@
+Creating a linear array:\\
+{\ex \lstinline| x = linspace(0, 2*pi, 50)|}
+
+Plotting two variables:\\
+{\ex \lstinline| plot(x, sin(x))|}
+
+Plotting two lists of equal length x, y:\\
+{\ex \lstinline| plot(x, y)|}
diff --git a/manipulating-lists.rst b/manipulating-lists/script.rst
index b6993fb..6d7d4b2 100644
--- a/manipulating-lists.rst
+++ b/manipulating-lists/script.rst
@@ -1,8 +1,28 @@
-Hello friends. Welcome to this spoken tutorial on Getting started with
-strings.
+.. Objectives
+.. ----------
+
+.. Clearly state the objectives of the LO (along with RBT level)
+
+.. Prerequisites
+.. -------------
+
+.. 1. getting started with lists
+.. 2.
+.. 3.
+
+.. Author : Madhu
+ Internal Reviewer :
+ External Reviewer :
+ Checklist OK? : <put date stamp here, if OK> [2010-10-05]
+
+Script
+------
{{{ Show the slide containing the title }}}
+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,
@@ -42,7 +62,7 @@ starting from 11 upto 19th. It is a very important to remember that
when ever we specify a range of elements in Python the start index is
included and end index is not included. So in the above case, 11 which
was the element with the index 4 was included but 23 which was the
-element with index 8 was exluded.
+element with index 8 was excluded.
Generalizing, we can obtain a slice of the list "p" from the index
"start" upto the index "end" but excluding "end" with the following
@@ -171,10 +191,6 @@ we learnt
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!
-.. Author : Madhu
- Internal Reviewer 1 : [potential reviewer: Nishanth]
- Internal Reviewer 2 : [potential reviewer: Amit]
- External Reviewer :
diff --git a/manipulating-lists/slides.org b/manipulating-lists/slides.org
new file mode 100644
index 0000000..5d2ce93
--- /dev/null
+++ b/manipulating-lists/slides.org
@@ -0,0 +1,123 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+
+#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
+#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
+
+#+LaTeX_HEADER: \usepackage{listings}
+
+#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
+#+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
+#+LaTeX_HEADER: showstringspaces=false, keywordstyle=\color{blue}\bfseries}
+
+#+TITLE: Accessing parts of arrays
+#+AUTHOR: FOSSEE
+#+EMAIL:
+#+DATE:
+
+#+DESCRIPTION:
+#+KEYWORDS:
+#+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
+
+* 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
+* Question 1
+ Change the last column of ~C~ to zeroes.
+* Solution 1
+ #+begin_src python
+ In []: C[:, -1] = 0
+ #+end_src
+* Question 2
+ Change ~A~ to ~[11, 12, 13, 14, 15]~.
+* 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
+* Question 3
+ - obtain ~[22, 23]~ from ~C~.
+ - obtain ~[11, 21, 31, 41]~ from ~C~.
+ - obtain ~[21, 31, 41, 0]~.
+* 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
+ #+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
+
+* 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.
+* Thank you!
+#+begin_latex
+ \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_latex
+
+
diff --git a/manipulating-lists/slides.tex b/manipulating-lists/slides.tex
new file mode 100644
index 0000000..df1462c
--- /dev/null
+++ b/manipulating-lists/slides.tex
@@ -0,0 +1,106 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%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}
+\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{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}
+\date{}
+
+% DOCUMENT STARTS
+\begin{document}
+
+\begin{frame}
+ \maketitle
+\end{frame}
+
+\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}
+\end{frame}
+
+\end{document}
diff --git a/matrices/script.rst b/matrices/script.rst
index 4bc3a3f..75c562a 100644
--- a/matrices/script.rst
+++ b/matrices/script.rst
@@ -1,17 +1,35 @@
-.. 4.3 LO: Matrices (3) [anoop]
-.. -----------------------------
-.. * creating matrices
-.. + direct data
-.. + list conversion
-.. + builtins - identitiy, zeros,
-.. * matrix operations
-.. + + - * /
-.. + dot
-.. + inv
-.. + det
-.. + eig
-.. + norm
-.. + svd
+.. Objectives
+.. ----------
+
+.. At the end of this tutorial, you will be able to
+
+.. 1. Create matrices using data.
+.. #. Create matrices from lists.
+.. #. Basic matrix operations.
+.. #. Use ``inv()`` function to find inverse of a matrix.
+.. #. Use ``det()`` function to find determinant of a matrix.
+.. #. Use ``eig()`` and ``eigvals()`` functions to find eigen values
+ and vectors
+.. #. Use ``norm()`` function to find norm of a matrix.
+.. #. Use ``svd()`` function to find singular value decomposition of a
+ matrix.
+
+
+.. Prerequisites
+.. -------------
+
+.. 1. should have ``ipython`` and ``pylab`` installed.
+.. #. getting started with ``ipython``.
+.. #. getting started with lists.
+.. #. getting started with arrays.
+.. #. accessing part of arrays.
+
+
+.. Author : Anoop Jacob Thomas <anoop@fossee.in>
+ Internal Reviewer :
+ External Reviewer :
+ Checklist OK? : <put date stamp here, if OK> [2010-10-05]
+
========
Matrices
@@ -22,8 +40,10 @@ Welcome to the spoken tutorial on Matrices.
{{{ switch to next slide, outline slide }}}
-In this tutorial we will learn about matrices, creating matrices and
-matrix operations.
+In this tutorial we will learn about matrices, creating matrices using
+direct data, by converting a list, matrix operations. Finding inverse
+of a matrix, determinant of a matrix, eigen values and eigen vectors
+of a matrix, norm and singular value decomposition of matrices.
{{{ creating a matrix }}}
@@ -88,6 +108,8 @@ function ``multiply()``
multiply(m3,m2)
+{{{ switch to next slide, Matrix multiplication (cont'd) }}}
+
Now let us see an example for matrix multiplication. For doing matrix
multiplication we need to have two matrices of the order n by m and m
by r and the resulting matrix will be of the order n by r. Thus let us
@@ -108,11 +130,15 @@ in matrix object.
{{{ switch to next slide, recall from arrays }}}
-As we already saw in arrays, the functions ``identity()``,
-``zeros()``, ``zeros_like()``, ``ones()``, ``ones_like()`` may also be
-used with matrices.
+As we already saw in arrays, the functions ``identity()`` which
+creates an identity matrix of the order n by n, ``zeros()`` which
+creates a matrix of the order m by n with all zeros, ``zeros_like()``
+which creates a matrix with zeros with the shape of the matrix passed,
+``ones()`` which creates a matrix of order m by n with all ones,
+``ones_like()`` which creates a matrix with ones with the shape of the
+matrix passed. These functions can also be used with matrices.
-{{{ switch to next slide, matrix operations }}}
+{{{ switch to next slide, more matrix operations }}}
To find out the transpose of a matrix we can do,
::
@@ -178,8 +204,6 @@ we do,
norm(im5)
-Euclidean norm is also called Frobenius norm.
-
And to find out the Infinity norm of the matrix im5, we do,
::
diff --git a/matrices/slides.org b/matrices/slides.org
new file mode 100644
index 0000000..34caa29
--- /dev/null
+++ b/matrices/slides.org
@@ -0,0 +1,176 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+
+#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
+#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
+
+#+LaTeX_HEADER: \usepackage{listings}
+
+#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
+#+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
+#+LaTeX_HEADER: showstringspaces=false, keywordstyle=\color{blue}\bfseries}
+
+#+TITLE: Matrices
+#+AUTHOR: FOSSEE
+#+EMAIL:
+#+DATE:
+
+#+DESCRIPTION:
+#+KEYWORDS:
+#+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
+
+* Outline
+ - Creating Matrices
+ - using direct data
+ - converting a list
+ - Matrix operations
+ - Inverse of matrix
+ - Determinant of matrix
+ - Eigen values and Eigen vectors of matrices
+ - Norm of matrix
+ - Singular Value Decomposition of matrices
+
+* Creating a matrix
+ - Creating a matrix using direct data
+ : In []: m1 = matrix([1, 2, 3, 4])
+ - Creating a matrix using lists
+ : In []: l1 = [[1,2,3,4],[5,6,7,8]]
+ : In []: m2 = matrix(l1)
+ - A matrix is basically an array
+ : In []: m3 = array([[5,6,7,8],[9,10,11,12]])
+
+* Matrix operations
+ - Element-wise addition (both matrix should be of order ~mXn~)
+ : In []: m3 + m2
+ - Element-wise subtraction (both matrix should be of order ~mXn~)
+ : In []: m3 - m2
+* Matrix Multiplication
+ - Matrix Multiplication
+ : In []: m3 * m2
+ : Out []: ValueError: objects are not aligned
+ - Element-wise multiplication using ~multiply()~
+ : multiply(m3, m2)
+
+* Matrix Multiplication (cont'd)
+ - Create two compatible matrices of order ~nXm~ and ~mXr~
+ : In []: m1.shape
+ - matrix m1 is of order ~1 X 4~
+ - Creating another matrix of order ~4 X 2~
+ : In []: m4 = matrix([[1,2],[3,4],[5,6],[7,8]])
+ - Matrix multiplication
+ : In []: m1 * m4
+* Recall from ~array~
+ - The functions
+ - ~identity(n)~ -
+ creates an identity matrix of order ~nXn~
+ - ~zeros((m,n))~ -
+ creates a matrix of order ~mXn~ with 0's
+ - ~zeros_like(A)~ -
+ creates a matrix with 0's similar to the shape of matrix ~A~
+ - ~ones((m,n))~
+ creates a matrix of order ~mXn~ with 1's
+ - ~ones_like(A)~
+ creates a matrix with 1's similar to the shape of matrix ~A~
+ Can also be used with matrices
+
+* More matrix operations
+ Transpose of a matrix
+ : In []: m4.T
+* Exercise 1 : Frobenius norm \& inverse
+ Find out the Frobenius norm of inverse of a ~4 X 4~ matrix.
+ :
+ The matrix is
+ : m5 = matrix(arange(1,17).reshape(4,4))
+ - Inverse of A,
+ -
+ #+begin_latex
+ $A^{-1} = inv(A)$
+ #+end_latex
+ - Frobenius norm is defined as,
+ -
+ #+begin_latex
+ $||A||_F = [\sum_{i,j} abs(a_{i,j})^2]^{1/2}$
+ #+end_latex
+
+* Exercise 2: Infinity norm
+ Find the infinity norm of the matrix ~im5~
+ :
+ - Infinity norm is defined as,
+ #+begin_latex
+ $max([\sum_{i} abs(a_{i})^2])$
+ #+end_latex
+* ~norm()~ method
+ - Frobenius norm
+ : In []: norm(im5)
+ - Infinity norm
+ : In []: norm(im5, ord=inf)
+* Determinant
+ Find out the determinant of the matrix m5
+ :
+ - determinant can be found out using
+ - ~det(A)~ - returns the determinant of matrix ~A~
+* eigen values \& eigen vectors
+ Find out the eigen values and eigen vectors of the matrix ~m5~.
+ :
+ - eigen values and vectors can be found out using
+ : In []: eig(m5)
+ returns a tuple of /eigen values/ and /eigen vectors/
+ - /eigen values/ in tuple
+ - ~In []: eig(m5)[0]~
+ - /eigen vectors/ in tuple
+ - ~In []: eig(m5)[1]~
+ - Computing /eigen values/ using ~eigvals()~
+ : In []: eigvals(m5)
+* Singular Value Decomposition (~svd~)
+ #+begin_latex
+ $M = U \Sigma V^*$
+ #+end_latex
+ - U, an ~mXm~ unitary matrix over K.
+ -
+ #+begin_latex
+ $\Sigma$
+ #+end_latex
+ , an ~mXn~ diagonal matrix with non-negative real numbers on diagonal.
+ -
+ #+begin_latex
+ $V^*$
+ #+end_latex
+ , an ~nXn~ unitary matrix over K, denotes the conjugate transpose of V.
+ - SVD of matrix ~m5~ can be found out as,
+ : In []: svd(m5)
+* Summary
+ - Matrices
+ - creating matrices
+ - Matrix operations
+ - Inverse (~inv()~)
+ - Determinant (~det()~)
+ - Norm (~norm()~)
+ - Eigen values \& vectors (~eig(), eigvals()~)
+ - Singular Value Decomposition (~svd()~)
+
+* Thank you!
+#+begin_latex
+ \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_latex
+
+
diff --git a/matrices/slides.tex b/matrices/slides.tex
new file mode 100644
index 0000000..8e58583
--- /dev/null
+++ b/matrices/slides.tex
@@ -0,0 +1,357 @@
+% Created 2010-10-12 Tue 14:28
+\documentclass[presentation]{beamer}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\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
+\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}}
+
+\title{Matrices}
+\author{FOSSEE}
+\date{}
+
+\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+\begin{document}
+
+\maketitle
+
+
+
+
+
+
+
+
+
+\begin{frame}
+\frametitle{Outline}
+\label{sec-1}
+
+\begin{itemize}
+\item Creating Matrices
+
+\begin{itemize}
+\item using direct data
+\item converting a list
+\end{itemize}
+
+\item Matrix operations
+\item Inverse of matrix
+\item Determinant of matrix
+\item Eigen values and Eigen vectors of matrices
+\item Norm of matrix
+\item Singular Value Decomposition of matrices
+\end{itemize}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Creating a matrix}
+\label{sec-2}
+
+\begin{itemize}
+\item Creating a matrix using direct data
+\end{itemize}
+
+\begin{verbatim}
+ In []: m1 = matrix([1, 2, 3, 4])
+\end{verbatim}
+
+\begin{itemize}
+\item Creating a matrix using lists
+\end{itemize}
+
+\begin{verbatim}
+ In []: l1 = [[1,2,3,4],[5,6,7,8]]
+ In []: m2 = matrix(l1)
+\end{verbatim}
+
+\begin{itemize}
+\item A matrix is basically an array
+\end{itemize}
+
+\begin{verbatim}
+ In []: m3 = array([[5,6,7,8],[9,10,11,12]])
+\end{verbatim}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Matrix operations}
+\label{sec-3}
+
+\begin{itemize}
+\item Element-wise addition (both matrix should be of order \texttt{mXn})
+\begin{verbatim}
+ In []: m3 + m2
+\end{verbatim}
+
+\item Element-wise subtraction (both matrix should be of order \texttt{mXn})
+\begin{verbatim}
+ In []: m3 - m2
+\end{verbatim}
+
+\end{itemize}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Matrix Multiplication}
+\label{sec-4}
+
+\begin{itemize}
+\item Matrix Multiplication
+\begin{verbatim}
+ In []: m3 * m2
+ Out []: ValueError: objects are not aligned
+\end{verbatim}
+
+\item Element-wise multiplication using \texttt{multiply()}
+\begin{verbatim}
+ multiply(m3, m2)
+\end{verbatim}
+
+\end{itemize}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Matrix Multiplication (cont'd)}
+\label{sec-5}
+
+\begin{itemize}
+\item Create two compatible matrices of order \texttt{nXm} and \texttt{mXr}
+\begin{verbatim}
+ In []: m1.shape
+\end{verbatim}
+
+
+\begin{itemize}
+\item matrix m1 is of order \texttt{1 X 4}
+\end{itemize}
+
+\item Creating another matrix of order \texttt{4 X 2}
+\begin{verbatim}
+ In []: m4 = matrix([[1,2],[3,4],[5,6],[7,8]])
+\end{verbatim}
+
+\item Matrix multiplication
+\begin{verbatim}
+ In []: m1 * m4
+\end{verbatim}
+
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{Recall from \texttt{array}}
+\label{sec-6}
+
+\begin{itemize}
+\item The functions
+
+\begin{itemize}
+\item \texttt{identity(n)} -
+ creates an identity matrix of order \texttt{nXn}
+\item \texttt{zeros((m,n))} -
+ creates a matrix of order \texttt{mXn} with 0's
+\item \texttt{zeros\_like(A)} -
+ creates a matrix with 0's similar to the shape of matrix \texttt{A}
+\item \texttt{ones((m,n))}
+ creates a matrix of order \texttt{mXn} with 1's
+\item \texttt{ones\_like(A)}
+ creates a matrix with 1's similar to the shape of matrix \texttt{A}
+\end{itemize}
+
+\end{itemize}
+
+ Can also be used with matrices
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{More matrix operations}
+\label{sec-7}
+
+ Transpose of a matrix
+\begin{verbatim}
+ In []: m4.T
+\end{verbatim}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Exercise 1 : Frobenius norm \& inverse}
+\label{sec-8}
+
+ Find out the Frobenius norm of inverse of a \texttt{4 X 4} matrix.
+\begin{verbatim}
+
+\end{verbatim}
+
+ The matrix is
+\begin{verbatim}
+ m5 = matrix(arange(1,17).reshape(4,4))
+\end{verbatim}
+
+\begin{itemize}
+\item Inverse of A,
+
+\begin{itemize}
+\item $A^{-1} = inv(A)$
+\end{itemize}
+
+\item Frobenius norm is defined as,
+
+\begin{itemize}
+\item $||A||_F = [\sum_{i,j} abs(a_{i,j})^2]^{1/2}$
+\end{itemize}
+
+\end{itemize}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Exercise 2: Infinity norm}
+\label{sec-9}
+
+ Find the infinity norm of the matrix \texttt{im5}
+\begin{verbatim}
+
+\end{verbatim}
+
+\begin{itemize}
+\item Infinity norm is defined as,
+ $max([\sum_{i} abs(a_{i})^2])$
+\end{itemize}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{\texttt{norm()} method}
+\label{sec-10}
+
+\begin{itemize}
+\item Frobenius norm
+\begin{verbatim}
+ In []: norm(im5)
+\end{verbatim}
+
+\item Infinity norm
+\begin{verbatim}
+ In []: norm(im5, ord=inf)
+\end{verbatim}
+
+\end{itemize}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Determinant}
+\label{sec-11}
+
+ Find out the determinant of the matrix m5
+\begin{verbatim}
+
+\end{verbatim}
+
+\begin{itemize}
+\item determinant can be found out using
+
+\begin{itemize}
+\item \texttt{det(A)} - returns the determinant of matrix \texttt{A}
+\end{itemize}
+
+\end{itemize}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{eigen values \& eigen vectors}
+\label{sec-12}
+
+ Find out the eigen values and eigen vectors of the matrix \texttt{m5}.
+\begin{verbatim}
+
+\end{verbatim}
+
+\begin{itemize}
+\item eigen values and vectors can be found out using
+\begin{verbatim}
+ In []: eig(m5)
+\end{verbatim}
+
+ returns a tuple of \emph{eigen values} and \emph{eigen vectors}
+\item \emph{eigen values} in tuple
+
+\begin{itemize}
+\item \texttt{In []: eig(m5)[0]}
+\end{itemize}
+
+\item \emph{eigen vectors} in tuple
+
+\begin{itemize}
+\item \texttt{In []: eig(m5)[1]}
+\end{itemize}
+
+\item Computing \emph{eigen values} using \texttt{eigvals()}
+\begin{verbatim}
+ In []: eigvals(m5)
+\end{verbatim}
+
+\end{itemize}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Singular Value Decomposition (\texttt{svd})}
+\label{sec-13}
+
+ $M = U \Sigma V^*$
+\begin{itemize}
+\item U, an \texttt{mXm} unitary matrix over K.
+\item $\Sigma$
+ , an \texttt{mXn} diagonal matrix with non-negative real numbers on diagonal.
+\item $V^*$
+ , an \texttt{nXn} unitary matrix over K, denotes the conjugate transpose of V.
+\item SVD of matrix \texttt{m5} can be found out as,
+\end{itemize}
+
+\begin{verbatim}
+ In []: svd(m5)
+\end{verbatim}
+\end{frame}
+\begin{frame}
+\frametitle{Summary}
+\label{sec-14}
+
+\begin{itemize}
+\item Matrices
+
+\begin{itemize}
+\item creating matrices
+\end{itemize}
+
+\item Matrix operations
+\item Inverse (\texttt{inv()})
+\item Determinant (\texttt{det()})
+\item Norm (\texttt{norm()})
+\item Eigen values \& vectors (\texttt{eig(), eigvals()})
+\item Singular Value Decomposition (\texttt{svd()})
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{Thank you!}
+\label{sec-15}
+
+ \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}
diff --git a/multiple-plots.rst b/multiple-plots/script.rst
index ef4e148..08b0892 100644
--- a/multiple-plots.rst
+++ b/multiple-plots/script.rst
@@ -1,7 +1,33 @@
-Hello friends. Welcome to this spoken tutorial on Multiple plots.
+.. Objectives
+.. ----------
+
+.. * How to draw multiple plots which are overlaid
+.. * the figure command
+.. * the legend command
+.. * how to switch between the plots and perform some operations on each
+.. of them like saving the plots and
+.. * creating and switching between subplots
+
+
+.. Prerequisites
+.. -------------
+
+.. 1. using the plot command interactively
+.. 2. embellishing a plot
+.. 3. saving plots
+
+.. Author : Madhu
+ Internal Reviewer 1 : [potential reviewer: Puneeth]
+ Internal Reviewer 2 : Nishanth
+ External Reviewer :
+
+Script
+------
{{{ Show the slide containing the title }}}
+Hello friends. Welcome to this spoken tutorial on Multiple plots.
+
{{{ Show the slide containing the outline }}}
In this tutorial, we will learn how to draw more than one plot, how to
@@ -353,10 +379,5 @@ we learnt
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!
-.. Author : Madhu
- Internal Reviewer 1 : [potential reviewer: Puneeth]
- Internal Reviewer 2 : Nishanth
- External Reviewer :
-
diff --git a/multiple-plots/slides.org b/multiple-plots/slides.org
new file mode 100644
index 0000000..5d2ce93
--- /dev/null
+++ b/multiple-plots/slides.org
@@ -0,0 +1,123 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+
+#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
+#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
+
+#+LaTeX_HEADER: \usepackage{listings}
+
+#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
+#+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
+#+LaTeX_HEADER: showstringspaces=false, keywordstyle=\color{blue}\bfseries}
+
+#+TITLE: Accessing parts of arrays
+#+AUTHOR: FOSSEE
+#+EMAIL:
+#+DATE:
+
+#+DESCRIPTION:
+#+KEYWORDS:
+#+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
+
+* 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
+* Question 1
+ Change the last column of ~C~ to zeroes.
+* Solution 1
+ #+begin_src python
+ In []: C[:, -1] = 0
+ #+end_src
+* Question 2
+ Change ~A~ to ~[11, 12, 13, 14, 15]~.
+* 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
+* Question 3
+ - obtain ~[22, 23]~ from ~C~.
+ - obtain ~[11, 21, 31, 41]~ from ~C~.
+ - obtain ~[21, 31, 41, 0]~.
+* 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
+ #+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
+
+* 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.
+* Thank you!
+#+begin_latex
+ \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_latex
+
+
diff --git a/multiple-plots/slides.tex b/multiple-plots/slides.tex
new file mode 100644
index 0000000..df1462c
--- /dev/null
+++ b/multiple-plots/slides.tex
@@ -0,0 +1,106 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%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}
+\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{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}
+\date{}
+
+% DOCUMENT STARTS
+\begin{document}
+
+\begin{frame}
+ \maketitle
+\end{frame}
+
+\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}
+\end{frame}
+
+\end{document}
diff --git a/other-type-of-plots/script.rst b/other-type-of-plots/script.rst
index aa5e25b..9664dd0 100644
--- a/other-type-of-plots/script.rst
+++ b/other-type-of-plots/script.rst
@@ -1,10 +1,27 @@
-.. 2.4 LO: other types of plots (3) [anoop]
-.. -----------------------------------------
-.. * scatter
-.. * pie chart
-.. * bar chart
-.. * log
-.. * illustration of other plots, matplotlib help
+.. Objectives
+.. ----------
+
+.. At the end of this tutorial, you will be able to
+
+.. 1. Create scatter plot
+.. #. Create pie charts
+.. #. Create bar charts
+.. #. Create log-log plots.
+
+.. Prerequisites
+.. -------------
+
+.. 1. should have ``ipython`` and ``pylab`` installed.
+.. #. getting started with ``ipython``.
+.. #. loading data from files
+.. #. plotting the data
+
+
+.. Author : Anoop Jacob Thomas <anoop@fossee.in>
+ Internal Reviewer :
+ External Reviewer :
+ Checklist OK? : <put date stamp here, if OK> [2010-10-05]
+
===================
Other type of plots
@@ -17,12 +34,12 @@ Hello and welcome to the tutorial other type of plots.
{{{ show the outline slide }}}
In this tutorial we will cover scatter plot, pie chart, bar chart and
-log plot. We will also see few other plots and also introduce you to
+loglog plot. We will also see few other plots and also introduce you to
the matplotlib help.
Let us start with scatter plot.
-{{{ switch to the next slide }}}
+{{{ switch to the next slide, scatter plot }}}
In a scatter plot, the data is displayed as a collection of points,
each having the value of one variable determining the position on the
@@ -55,12 +72,14 @@ profit percentages.
{{{ close the file and switch to the terminal }}}
To produce the scatter plot first we need to load the data from the
-file using ``loadtxt``. We learned in one of the previous sessions,
+file using ``loadtxt``. We learned it in one of the previous sessions,
and it can be done as ::
year,profit =
loadtxt('/home/fossee/other-plot/company-a-data.txt',dtype=type(int()))
+{{{ switch to next slide, ``scatter`` function }}}
+
Now in-order to generate the scatter graph we will use the function
``scatter()``
::
@@ -75,9 +94,11 @@ y-coordinate, the profit percentage.
problem to be tried out }}}
Now here is a question for you to try out, plot the same data with red
-diamonds.
+diamonds markers.
-**Clue** - *try scatter? in your ipython interpreter*
+.. **Clue** - *try scatter? in your ipython interpreter*
+
+Pause here and solve the question before moving on.
.. scatter(year,profit,color='r',marker='d')
@@ -95,6 +116,8 @@ Plot a pie chart representing the profit percentage of company A, with
the same data from file ``company-a-data.txt``. So let us reuse the
data we have loaded from the file previously.
+{{{ switch to next slide, ``pie()`` function }}}
+
We can plot the pie chart using the function ``pie()``.
::
@@ -111,7 +134,9 @@ Now here is a question for you to try out, plot a pie chart with the
same data with colors for each wedges as white, red, black, magenta,
yellow, blue, green, cyan, yellow, magenta and blue respectively.
-**Clue** - *try pie? in your ipython interpreter*
+.. **Clue** - *try pie? in your ipython interpreter*
+
+Pause here and solve the question before moving on.
.. pie(t,labels=s,colors=('w','r','k','m','y','b','g','c','y','m','b'))
@@ -121,7 +146,7 @@ Now let us move on to bar chart. A bar chart or bar graph is a chart
with rectangular bars with lengths proportional to the values that
they represent.
-{{{ switch to the slide showing the problem statement of third
+{{{ switch to the slide showing the problem statement of fifth
exercise question }}}
Plot a bar chart representing the profit percentage of company A, with
@@ -129,6 +154,8 @@ the same data from file ``company-a-data.txt``.
So let us reuse the data we have loaded from the file previously.
+{{{ switch to the next slide, ``bar()`` function }}}
+
We can plot the bar chart using the function ``bar()``.
::
@@ -143,13 +170,14 @@ problem to be tried out }}}
Now here is a question for you to try, plot a bar chart which is not
filled and which is hatched with 45\ :sup:`o` slanting lines as shown
-in the image in the slide.
+in the image in the slide. The data for the chart may be obtained from
+the file ``company-a-data.txt``.
-**Clue** - *try bar? in your ipython interpreter*
+.. **Clue** - *try bar? in your ipython interpreter*
.. bar(year,profit,fill=False,hatch='/')
-{{{ switch to the slide which says about bar chart }}}
+{{{ switch to the slide which says about log-log graph }}}
Now let us move on to log-log plot. A log-log graph or log-log plot is
a two-dimensional graph of numerical data that uses logarithmic scales
@@ -170,6 +198,8 @@ that. And it could be done as,
x = linspace(1,20,100)
y = 5*x**3
+{{{ switch to next slide, ``loglog()`` function }}}
+
Now we can plot the log-log chart using ``loglog()`` function,
::
@@ -200,7 +230,7 @@ More plots can be seen at
matplotlib.sourceforge.net/users/screenshots.html and also at
matplotlib.sourceforge.net/gallery.html
-{{{ switch to recap slide }}}
+{{{ switch to summary slide }}}
Now we have come to the end of this tutorial. We have covered scatter
plot, pie chart, bar chart, log-log plot and also saw few other plots
@@ -209,8 +239,3 @@ and covered how to access the matplotlib online help.
{{{ switch to the thank you slide }}}
Thank you!
-
-.. Author: Anoop Jacob Thomas <anoop@fossee.in>
- Reviewer 1:
- Reviewer 2:
- External reviewer:
diff --git a/other-type-of-plots/slides.org b/other-type-of-plots/slides.org
new file mode 100644
index 0000000..f63ab12
--- /dev/null
+++ b/other-type-of-plots/slides.org
@@ -0,0 +1,137 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+
+#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
+#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
+
+#+LaTeX_HEADER: \usepackage{listings}
+
+#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
+#+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
+#+LaTeX_HEADER: showstringspaces=false, keywordstyle=\color{blue}\bfseries}
+
+#+TITLE: Other type of plots
+#+AUTHOR: FOSSEE
+#+EMAIL:
+#+DATE:
+
+#+DESCRIPTION:
+#+KEYWORDS:
+#+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
+
+* Outline
+ - Scatter plot
+ - Pie chart
+ - Bar chart
+ - Log-log Plot
+ - ~matplotlib~ help
+* Exercise 1: Scatter plot
+ Plot a scatter plot showing the percentage profit of Company A from the year 2000
+ to 2010. The data for the same is available in the file ~company-a-data.txt~.
+* ~scatter()~ function
+ - /Syntax :/ scatter(x,y)
+ - x, a sequence of data
+ - y, a sequence of data, the same length of x
+ : In []: scatter(year, profit)
+* Exercise 2: Scatter plot
+ Plot a scatter plot of the same data in ~company-a-data.txt~ with red diamond markers.
+ :
+ *Clue* - /try scatter? in your ipython interpreter/
+* Pie chart
+ Pie chart - a circle graph divided into sectors, illustrating proportion.
+* Exercise 3: Pie chart
+ Plot a pie chart representing the profit percentage of company A, with the data
+ from the file ~company-a-data.txt~.
+ :
+ /(we can reuse the data in lists year and profit)/
+* ~pie()~ function
+ - /Syntax :/ pie(values, labels=labels)
+ - values, the data to be plotted
+ - labels, the label for each wedge in the pie chart
+ : In []: pie(profit, labels=year)
+* Exercise 4: Pie chart
+ Plot a pie chart with the same data with colors for each wedges as white, red,
+ magenta, yellow, blue, green, cyan, yellow, magenta, and blue.
+ :
+ *Clue* - /try pie? in your ipython interpreter/
+* Bar chart
+ Bar chart - a chart with rectangular bars with lengths proportional
+ to the values that they represent.
+* Exercise 5: Bar chart
+ Plot a bar chart representing the profit percentage of company A, with the data
+ from the file ~company-a-data.txt~.
+ :
+ /(we can reuse the data in lists year and profit)/
+* ~bar()~ function
+ - /Syntax :/ bar(x, y)
+ - x, a sequence of data
+ - y, a sequence of data, the same length of x
+ : In []: bar(year, profit)
+* Exercise 6: Bar chart
+ Plot a bar chart which is not filled and which is hatched with
+ #+begin_latex
+ $45^o$
+ #+end_latex
+ slanting lines as shown in the image. The data for the chart may be
+ obtained from the file ~company-a-data.txt~.
+ #+begin_latex
+ \begin{center}
+ \includegraphics[scale=0.3]{bar-chart-hatch}
+ \end{center}
+ #+end_latex
+ *Clue* - /try bar? in your ipython interpreter/
+* Log-log graph
+ - Log-log graph
+ - 2-dimensional graph.
+ - uses logarithmic scales on both axes.
+ - graph appears as straight line due to non-linear scaling.
+* Exercise 7:
+ Plot a log-log chart of
+ #+begin_latex
+ $y = 5x^3$
+ #+end_latex
+ for x from 1-20.
+* ~loglog()~ function
+ - /Syntax :/ loglog(x, y)
+ - x, a sequence of data
+ - y, a sequence of data, the same length of x
+ : In []: loglog(x, y)
+* Getting help on ~matplotlib~
+ - Help
+ - [[matplotlib.sourceforge.net/contents.html]]
+ - More plots
+ - [[matplotlib.sourceforge.net/users/screenshots.html]]
+ - [[matplotlib.sourceforge.net/gallery.html]]
+
+* Summary
+ - Scatter plot (~scatter()~)
+ - Pie chart (~pie()~)
+ - Bar chart (~bar()~)
+ - Log-log plot (~loglog()~)
+ - ~matplotlib~ online help
+* Thank you!
+#+begin_latex
+ \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_latex
+
+
diff --git a/other-type-of-plots/slides.tex b/other-type-of-plots/slides.tex
new file mode 100644
index 0000000..c0b4180
--- /dev/null
+++ b/other-type-of-plots/slides.tex
@@ -0,0 +1,280 @@
+% Created 2010-10-12 Tue 16:22
+\documentclass[presentation]{beamer}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\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
+\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}}
+
+\title{Other type of plots}
+\author{FOSSEE}
+\date{}
+
+\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+\begin{document}
+
+\maketitle
+
+
+
+
+
+
+
+
+
+\begin{frame}
+\frametitle{Outline}
+\label{sec-1}
+
+\begin{itemize}
+\item Scatter plot
+\item Pie chart
+\item Bar chart
+\item Log-log Plot
+\item \texttt{matplotlib} help
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{Exercise 1: Scatter plot}
+\label{sec-2}
+
+ Plot a scatter plot showing the percentage profit of Company A from the year 2000
+ to 2010. The data for the same is available in the file \texttt{company-a-data.txt}.
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{\texttt{scatter()} function}
+\label{sec-3}
+
+\begin{itemize}
+\item \emph{Syntax :} scatter(x,y)
+
+\begin{itemize}
+\item x, a sequence of data
+\item y, a sequence of data, the same length of x
+\end{itemize}
+
+\end{itemize}
+
+\begin{verbatim}
+ In []: scatter(year, profit)
+\end{verbatim}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Exercise 2: Scatter plot}
+\label{sec-4}
+
+ Plot a scatter plot of the same data in \texttt{company-a-data.txt} with red diamond markers.
+\begin{verbatim}
+
+\end{verbatim}
+
+ \textbf{Clue} - \emph{try scatter? in your ipython interpreter}
+\end{frame}
+\begin{frame}
+\frametitle{Pie chart}
+\label{sec-5}
+
+ Pie chart - a circle graph divided into sectors, illustrating proportion.
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Exercise 3: Pie chart}
+\label{sec-6}
+
+ Plot a pie chart representing the profit percentage of company A, with the data
+ from the file \texttt{company-a-data.txt}.
+\begin{verbatim}
+
+\end{verbatim}
+
+ \emph{(we can reuse the data in lists year and profit)}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{\texttt{pie()} function}
+\label{sec-7}
+
+\begin{itemize}
+\item \emph{Syntax :} pie(values, labels=labels)
+
+\begin{itemize}
+\item values, the data to be plotted
+\item labels, the label for each wedge in the pie chart
+\end{itemize}
+
+\end{itemize}
+
+\begin{verbatim}
+ In []: pie(profit, labels=year)
+\end{verbatim}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Exercise 4: Pie chart}
+\label{sec-8}
+
+ Plot a pie chart with the same data with colors for each wedges as white, red,
+ magenta, yellow, blue, green, cyan, yellow, magenta, and blue.
+\begin{verbatim}
+
+\end{verbatim}
+
+ \textbf{Clue} - \emph{try pie? in your ipython interpreter}
+\end{frame}
+\begin{frame}
+\frametitle{Bar chart}
+\label{sec-9}
+
+ Bar chart - a chart with rectangular bars with lengths proportional
+ to the values that they represent.
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Exercise 5: Bar chart}
+\label{sec-10}
+
+ Plot a bar chart representing the profit percentage of company A, with the data
+ from the file \texttt{company-a-data.txt}.
+\begin{verbatim}
+
+\end{verbatim}
+
+ \emph{(we can reuse the data in lists year and profit)}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{\texttt{bar()} function}
+\label{sec-11}
+
+\begin{itemize}
+\item \emph{Syntax :} bar(x, y)
+
+\begin{itemize}
+\item x, a sequence of data
+\item y, a sequence of data, the same length of x
+\end{itemize}
+
+\end{itemize}
+
+\begin{verbatim}
+ In []: bar(year, profit)
+\end{verbatim}
+\end{frame}
+\begin{frame}
+\frametitle{Exercise 6: Bar chart}
+\label{sec-12}
+
+ Plot a bar chart which is not filled and which is hatched with
+ $45^o$
+ slanting lines as shown in the image. The data for the chart may be
+ obtained from the file \texttt{company-a-data.txt}.
+ \begin{center}
+ \includegraphics[scale=0.3]{bar-chart-hatch}
+ \end{center}
+ \textbf{Clue} - \emph{try bar? in your ipython interpreter}
+\end{frame}
+\begin{frame}
+\frametitle{Log-log graph}
+\label{sec-13}
+
+\begin{itemize}
+\item Log-log graph
+
+\begin{itemize}
+\item 2-dimensional graph.
+\item uses logarithmic scales on both axes.
+\item graph appears as straight line due to non-linear scaling.
+\end{itemize}
+
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{Exercise 7:}
+\label{sec-14}
+
+ Plot a log-log chart of
+ $y = 5x^3$
+ for x from 1-20.
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{\texttt{loglog()} function}
+\label{sec-15}
+
+\begin{itemize}
+\item \emph{Syntax :} loglog(x, y)
+
+\begin{itemize}
+\item x, a sequence of data
+\item y, a sequence of data, the same length of x
+\end{itemize}
+
+\end{itemize}
+
+\begin{verbatim}
+ In []: loglog(x, y)
+\end{verbatim}
+\end{frame}
+\begin{frame}
+\frametitle{Getting help on \texttt{matplotlib}}
+\label{sec-16}
+
+\begin{itemize}
+\item Help
+
+\begin{itemize}
+\item \hyperref[sec-16]{matplotlib.sourceforge.net/contents.html}
+\end{itemize}
+
+\item More plots
+
+\begin{itemize}
+\item \hyperref[sec-16]{matplotlib.sourceforge.net/users/screenshots.html}
+\item \hyperref[sec-16]{matplotlib.sourceforge.net/gallery.html}
+\end{itemize}
+
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{Summary}
+\label{sec-17}
+
+\begin{itemize}
+\item Scatter plot (\texttt{scatter()})
+\item Pie chart (\texttt{pie()})
+\item Bar chart (\texttt{bar()})
+\item Log-log plot (\texttt{loglog()})
+\item \texttt{matplotlib} online help
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{Thank you!}
+\label{sec-18}
+
+ \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}
diff --git a/plotting-data/plotting-data.rst b/plotting-data/plotting-data.rst
new file mode 100644
index 0000000..3af6dda
--- /dev/null
+++ b/plotting-data/plotting-data.rst
@@ -0,0 +1,136 @@
+Plotting Experimental Data
+=============================
+Hello and welcome , this tutorial on Plotting Experimental data is
+presented by the fossee team.
+
+{{{ Show the slide containing title }}}
+
+
+{{{ Show the Outline Slide }}}
+
+Here we will discuss plotting Experimental data.
+
+1. We will see how we can represent a sequence of numbers in Python.
+
+2. We will also become fimiliar with elementwise squaring of such a
+sequence.
+
+3. We will also see how we can use our graph to indicate Error.
+
+One needs to be fimiliar with the concepts of plotting
+mathematical functions in Python.
+
+We will use data from a Simple Pendulum Experiment to illustrate our
+points.
+
+{{{ Simple Pendulum data Slide }}}
+
+
+
+
+As we know for a simple pendulum length,L is directly proportional to
+the square of time,T. We shall be plotting L and T^2 values.
+
+
+First we will have to initiate L and T values. We initiate them as sequence
+of values. To tell ipython a sequence of values we write the sequence in
+comma seperated values inside two square brackets. This is also called List
+so to create two sequences
+
+L,t type in ipython shell. ::
+
+ In []: L = [0.1, 0.2, 0.3, 0.4, 0.5,0.6, 0.7, 0.8, 0.9]
+
+ In []: t= [0.69, 0.90, 1.19,1.30, 1.47, 1.58, 1.77, 1.83, 1.94]
+
+
+
+To obtain the square of sequence t we will use the function square
+with argument t.This is saved into the variable tsquare.::
+
+ In []: tsquare=square(t)
+
+ array([ 0.4761, 0.81 , 1.4161, 1.69 , 2.1609, 2.4964, 3.1329,
+ 3.3489, 3.7636])
+
+
+Now to plot L vs T^2 we will simply type ::
+
+ In []: plot(L,t,.)
+
+'.' here represents to plot use small dots for the point. ::
+
+ In []: clf()
+
+You can also specify 'o' for big dots.::
+
+ In []: plot(L,t,o)
+
+ In []: clf()
+
+
+{{{ Slide with Error data included }}}
+
+
+Now we shall try and take into account error into our plots . The
+Error values for L and T are on your screen.We shall again intialize
+the sequence values in the same manner as we did for L and t ::
+
+ In []: delta_L= [0.08,0.09,0.07,0.05,0.06,0.00,0.06,0.06,0.01]
+
+ In []: delta_T= [0.04,0.08,0.11,0.05,0.03,0.03,0.01,0.07,0.01]
+
+
+
+Now to plot L vs T^2 with an error bar we use the function errorbar()
+
+The syntax of the command is as given on the screen. ::
+
+
+ In []: errorbar(L,tsquare,xerr=delta_L, yerr=delta_T, fmt='b.')
+
+This gives a plot with error bar for x and y axis. The dots are of blue color. The parameters xerr and yerr are error on x and y axis and fmt is the format of the plot.
+
+
+similarly we can draw the same error bar with big red dots just change
+the parameters to fmt to 'ro'. ::
+
+ In []: clf()
+ In []: errorbar(L,tsquare,xerr=delta_L, yerr=delta_T, fmt='ro')
+
+
+
+thats it. you can explore other options to errorbar using the documentation
+of errorbar.::
+
+ In []: errorbar?
+
+
+{{{ Summary Slides }}}
+
+In this tutorial we have learnt :
+
+1. How to declare a sequence of number , specifically the kind of sequence we learned was a list.
+
+2. Plotting experimental data extending our knowledge from mathematical functions.
+
+3. The various options available for plotting dots instead of lines.
+
+4. Plotting experimental data such that we can also represent error. We did this using the errorbar() function.
+
+
+ {{{ Show the "sponsored by FOSSEE" slide }}}
+
+
+
+This tutorial was created as a part of FOSSEE project.
+
+Hope you have enjoyed and found it useful.
+
+ Thankyou
+
+
+
+Author : Amit Sethi
+Internal Reviewer :
+Internal Reviewer 2 :
diff --git a/plotting-data/slides.org b/plotting-data/slides.org
new file mode 100644
index 0000000..f9ff4c2
--- /dev/null
+++ b/plotting-data/slides.org
@@ -0,0 +1,84 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\useoutertheme{infolines}\usecolortheme{default}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+#+OPTIONS: H:5 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
+
+#+TITLE: Plotting Experimental Data
+#+AUTHOR: FOSSEE
+#+DATE: 2010-09-14 Tue
+#+EMAIL: info@fossee.in
+
+# \author[FOSSEE] {FOSSEE}
+
+# \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
+# \date{}
+
+* Tutorial Plan
+** Plotting Experiment Data and Error Bars
+* Pre-requisites
+** Plotting simple analytical Functions
+* plot L vs. T^2
+
+#+ORGTBL: L vs T^2 orgtbl-to-latex
+
+ | L | T |
+ | 0.1 | 0.69 |
+ | 0.2 | 0.90 |
+ | 0.3 | 1.19 |
+ | 0.4 | 1.30 |
+ | 0.5 | 1.47 |
+ | 0.6 | 1.58 |
+ | 0.7 | 1.77 |
+ | 0.8 | 1.83 |
+ | 0.9 | 1.94 |
+
+
+
+
+* Initializing L & T
+ : In []: L = [0.1, 0.2, 0.3, 0.4, 0.5,
+ : 0.6, 0.7, 0.8, 0.9]
+ : In []: t = [0.69, 0.90, 1.19,
+ : 1.30, 1.47, 1.58,
+ : 1.77, 1.83, 1.94]
+* square()
+ : In []: tsquare=square(t)
+
+ : array([ 0.4761, 0.81 , 1.4161, 1.69 , 2.1609, 2.4964, 3.1329,
+ : 3.3489, 3.7636])
+
+
+* Plotting
+ : In[]: plot(L,t,.)
+
+
+ : In[]: plot(L,t,o)
+
+* Adding an Error Column
+
+
+ | L | T | /Delta L | /Delta T |
+ | 0.1 | 0.69 | 0.08 | 0.04 |
+ | 0.2 | 0.90 | 0.09 | 0.08 |
+ | 0.3 | 1.19 | 0.07 | 0.11 |
+ | 0.4 | 1.30 | 0.05 | 0.05 |
+ | 0.5 | 1.47 | 0.06 | 0.03 |
+ | 0.6 | 1.58 | 0.00 | 0.03 |
+ | 0.7 | 1.77 | 0.06 | 0.01 |
+ | 0.8 | 1.83 | 0.06 | 0.07 |
+ | 0.9 | 1.94 | 0.01 | 0.01 |
+
+
+* Plotting Error bar
+
+ : In[]: delta_L= [0.08,0.09,0.07,0.05,0.16,
+ : 0.00,0.06,0.06,0.01]
+ : In[]: delta_T= [0.04,0.08,0.11,0.05,0.03,
+ : 0.03,0.01,0.07,0.01]
+
+
+
diff --git a/plotui/quickref.tex b/plotui/quickref.tex
new file mode 100644
index 0000000..b26d168
--- /dev/null
+++ b/plotui/quickref.tex
@@ -0,0 +1,8 @@
+Creating a linear array:\\
+{\ex \lstinline| x = linspace(0, 2*pi, 50)|}
+
+Plotting two variables:\\
+{\ex \lstinline| plot(x, sin(x))|}
+
+Plotting two lists of equal length x, y:\\
+{\ex \lstinline| plot(x, y)|}
diff --git a/plotui/script.rst b/plotui/script.rst
new file mode 100644
index 0000000..2c5b955
--- /dev/null
+++ b/plotui/script.rst
@@ -0,0 +1,182 @@
+Hello and welcome to the tutorial on creating simple plots using
+Python.This tutorial is presented by the Fossee group.
+{{{ Show the Title Slide }}}
+
+I hope you have IPython running on your computer.
+
+In this tutorial we will look at plot command and also how to study
+the plot using the UI.
+
+{{{ Show Outline Slide }}}
+
+Lets start ipython on your shell, type ::
+
+ $ipython -pylab
+
+
+Pylab is a python library which provides plotting functionality.It
+also provides many other important mathematical and scientific
+functions. After running IPython -pylab in your shell if at the top of
+the result of this command, you see something like ::
+
+
+ `ERROR: matplotlib could NOT be imported! Starting normal
+ IPython.`
+
+
+{{{ Slide with Error written on it }}}
+
+Then you have to install matplotlib and run this command again.
+
+Now type in your ipython shell ::
+
+ In[]: linpace?
+
+
+
+as the documentation says, it returns `num` evenly spaced samples,
+calculated over the interval start and stop. To illustrate this, lets
+do it form 1 to 100 and try 100 points. ::
+
+ In[]: linspace(1,100,100)
+
+As you can see a sequence of numbers from 1 to 100 appears.
+
+Now lets try 200 points between 0 and 1 you do this by typing ::
+
+
+ In[]: linspace(0,1,200)
+
+0 for start , 1 for stop and 200 for no of points. In linspace
+the start and stop points can be integers, decimals , or
+constants. Let's try and get 100 points between -pi to pi. Type ::
+
+ In[]: p = linspace(-pi,pi,100)
+
+
+'pi' here is constant defined by pylab. Save this to the variable, p
+.
+
+If you now ::
+
+ In[]: len(p)
+
+You will get the no. of points. len function gives the no of elements
+of a sequence.
+
+
+Let's try and plot a cosine curve between -pi and pi using these
+points. Simply type ::
+
+
+ In[]: plot(p,cos(points))
+
+Here cos(points) gets the cosine value at every corresponding point to
+p.
+
+
+We can also save cos(points) to variable cosine and plot it using
+plot.::
+
+ In[]: cosine=cos(points)
+
+ In[]: plot(p,cosine)
+
+
+
+Now do ::
+
+ In[]: clf()
+
+this will clear the plot.
+
+This is done because any other plot we try to make shall come on the
+same drawing area. As we do not wish to clutter the area with
+overlaid plots , we just clear it with clf(). Now lets try a sine
+plot. ::
+
+
+ In []: plot(p,sin(p))
+
+
+
+
+The Window on which the plot appears can be used to study it better.
+
+First of all moving the mouse around gives us the point where mouse
+points at.
+
+Also we have some buttons the right most among them is
+for saving the file.
+
+Just click on it specifying the name of the file. We will save the plot
+by the name sin_curve in pdf format.
+
+
+
+{{{ Action corelating with the words }}}
+
+As you can see I can specify format of file from the dropdown.
+
+Formats like png ,eps ,pdf, ps are available.
+
+Left to the save button is the slider button to specify the margins.
+
+{{{ Action corelating with the words }}}
+
+Left to this is zoom button to zoom into the plot. Just specify the
+region to zoom into.
+The button left to it can be used to move the axes of the plot.
+
+{{{ Action corelating with the words }}}
+
+The next two buttons with a left and right arrow icons change the state of the
+plot and take it to the previous state it was in. It more or less acts like a
+back and forward button in the browser.
+
+{{{ Action corelating with the words }}}
+
+The last one is 'home' referring to the initial plot.
+
+{{{ Action corelating with the words}}}
+
+
+
+{{{ Summary Slide }}}
+
+
+In this tutorial we have looked at
+
+1. Starting Ipython with pylab
+
+2. Using linspace function to create `num` equaly spaced points in a region.
+
+3. Finding length of sequnces using len.
+
+4. Plotting mathematical functions using plot.
+
+4. Clearing drawing area using clf
+
+5. Using the UI of plot for studying it better . Using functionalities like save , zoom , moving the plots on x and y axis
+
+etc ..
+
+
+
+{{{ Show the "sponsored by FOSSEE" slide }}}
+
+
+
+This tutorial was created as a part of FOSSEE project, NME ICT, MHRD India
+
+
+
+ Hope you have enjoyed and found it useful.
+
+ Thankyou
+
+
+
+Author : Amit Sethi
+Internal Reviewer :
+Internal Reviewer 2 :
diff --git a/plotui/slides.tex b/plotui/slides.tex
new file mode 100644
index 0000000..df1462c
--- /dev/null
+++ b/plotui/slides.tex
@@ -0,0 +1,106 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%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}
+\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{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}
+\date{}
+
+% DOCUMENT STARTS
+\begin{document}
+
+\begin{frame}
+ \maketitle
+\end{frame}
+
+\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}
+\end{frame}
+
+\end{document}
diff --git a/progress.org b/progress.org
index 763789c..79dfc89 100644
--- a/progress.org
+++ b/progress.org
@@ -1,55 +1,55 @@
-| S.No | Name | Units | Author | 1st Review (Status) | 2nd Review (Status) |
-|---------+----------------------------------------+-------+----------+---------------------+---------------------|
-| 1.2 LO: | getting started with =ipython= | 2 | Punch | | |
-| 1.3 LO: | using the =plot= command interactively | 2 | Amit | Anoop (Pending) | Puneeth (Pending) |
-| 1.4 LO: | embellishing a plot | 2 | Nishanth | Anoop (Done) | Madhu (Done) |
-| 1.5 LO: | saving plots | 2 | Anoop | | |
-| 1.6 LO: | multiple plots | 3 | Madhu | Nishanth (Done) | Punch (Pending) |
-| 1.7 LO: | additional features of IPython | 2 | Nishanth | Amit (Pending) | Madhu (Pending) |
-| 1.8 LO: | module level assessment | 3 | Madhu | | |
-|---------+----------------------------------------+-------+----------+---------------------+---------------------|
-| 2.2 LO: | loading data from files | 3 | Punch | Nishanth (Done) | Anoop (Pending) |
-| 2.3 LO: | plotting the data | 3 | Amit | Anoop (Pending) | Punch (Pending) |
-| 2.4 LO: | other types of plots | 3 | Anoop | | |
-| 2.5 LO: | module level assessment | 3 | Nishanth | | |
-|---------+----------------------------------------+-------+----------+---------------------+---------------------|
-| 3.1 LO: | getting started with lists | 2 | Amit | Madhu (Pending) | Nishanth (Done) |
-| 3.2 LO: | getting started with =for= | 2 | Anoop | Nishanth (Done) | Amit (Done) |
-| 3.3 LO: | getting started with strings | 2 | Madhu | | |
-| 3.4 LO: | getting started with files | 3 | Punch | | |
-| 3.5 LO: | parsing data | 3 | Nishanth | Amit (Done) | Punch (Pending) |
-| 3.6 LO: | statistics | 2 | Amit | Anoop (Pending) | Puneeth (Pending) |
-| 3.7 LO: | module level assessment | 3 | Madhu | | |
-|---------+----------------------------------------+-------+----------+---------------------+---------------------|
-| 4.1 LO: | getting started with arrays | 2 | Anoop | | |
-| 4.2 LO: | accessing parts of arrays | 4 | Punch | | |
-| 4.3 LO: | Matrices | 3 | Anoop | | |
-| 4.4 LO: | Least square fit | 2 | Nishanth | Punch (Pending) | Anoop (Pending) |
-| 4.5 LO: | Assessment | 3 | Punch | | |
-|---------+----------------------------------------+-------+----------+---------------------+---------------------|
-| 5.1 LO: | getting started with sage notebook | 3 | Madhu | | |
-| 5.2 LO: | getting started with symbolics | 3 | Amit | Madhu (Pending) | Nishanth (Pending) |
-| 5.3 LO: | using Sage | 4 | Punch | | |
-| 5.4 LO: | using sage to teach | 3 | Nishanth | | |
-| 5.5 LO: | Assessment | 3 | Anoop | | |
-|---------+----------------------------------------+-------+----------+---------------------+---------------------|
-| 6.1 LO: | basic datatypes & operators | 4 | Amit | Madhu (Pending) | Nishanth (Done) |
-| 6.2 LO: | I/O | 1 | Nishanth | | |
-| 6.3 LO: | conditionals | 2 | Madhu | | |
-| 6.4 LO: | loops | 2 | Puneeth | | |
-| 6.5 LO: | Assessment | 3 | Anoop | | |
-|---------+----------------------------------------+-------+----------+---------------------+---------------------|
-| 7.1 LO: | manipulating lists | 3 | Madhu | | |
-| 7.2 LO: | manipulating strings | 2 | Punch | | |
-| 7.3 LO: | getting started with tuples | 2 | Nishanth | | |
-| 7.4 LO: | dictionaries | 2 | Anoop | | |
-| 7.5 LO: | sets | 2 | Nishanth | | |
-| 7.6 LO: | Assessment | 3 | Amit | | |
-|---------+----------------------------------------+-------+----------+---------------------+---------------------|
-| 8.1 LO: | getting started with functions | 3 | Nishanth | | |
-| 8.2 LO: | advanced features of functions | 3 | Punch | | |
-| 8.3 LO: | using python modules | 3 | Anoop | | |
-| 8.4 LO: | writing python scripts | 2 | Nishanth | | |
-| 8.5 LO: | testing and debugging | 2 | Amit | | |
-| 8.6 LO: | Assessment | 3 | Madhu | | |
-|---------+----------------------------------------+-------+----------+---------------------+---------------------|
+| S.No | Name | Units | Author | Review | Checklist |
+|---------+----------------------------------------+-------+----------+-----------------+-----------|
+| 1.2 LO: | getting started with =ipython= | 2 | Punch | | |
+| 1.3 LO: | using the =plot= command interactively | 2 | Amit | | |
+| 1.4 LO: | embellishing a plot | 2 | Nishanth | Anoop (Done) | |
+| 1.5 LO: | saving plots | 2 | Anoop | | |
+| 1.6 LO: | multiple plots | 3 | Madhu | Nishanth (Done) | |
+| 1.7 LO: | additional features of IPython | 2 | Nishanth | Amit (Pending) | |
+| 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 | | |
+| 2.4 LO: | other types of plots | 3 | Anoop | | |
+| 2.5 LO: | module level assessment | 3 | Nishanth | | |
+|---------+----------------------------------------+-------+----------+-----------------+-----------|
+| 3.1 LO: | getting started with lists | 2 | Amit | | |
+| 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 | | |
+| 3.5 LO: | parsing data | 3 | Nishanth | Amit (Done) | |
+| 3.6 LO: | statistics | 2 | Amit | | |
+| 3.7 LO: | module level assessment | 3 | Madhu | | |
+|---------+----------------------------------------+-------+----------+-----------------+-----------|
+| 4.1 LO: | getting started with arrays | 2 | Anoop | Punch (Done) | |
+| 4.2 LO: | accessing parts of arrays | 4 | Punch | | |
+| 4.3 LO: | Matrices | 3 | Anoop | | |
+| 4.4 LO: | Least square fit | 2 | Nishanth | Punch (Pending) | |
+| 4.5 LO: | Assessment | 3 | Punch | | |
+|---------+----------------------------------------+-------+----------+-----------------+-----------|
+| 5.1 LO: | getting started with sage notebook | 3 | Madhu | | |
+| 5.2 LO: | getting started with symbolics | 3 | Amit | | |
+| 5.3 LO: | using Sage | 4 | Punch | | |
+| 5.4 LO: | using sage to teach | 3 | Nishanth | | |
+| 5.5 LO: | Assessment | 3 | Anoop | | |
+|---------+----------------------------------------+-------+----------+-----------------+-----------|
+| 6.1 LO: | basic datatypes & operators | 4 | Amit | Punch (Pending) | |
+| 6.2 LO: | I/O | 1 | Nishanth | | |
+| 6.3 LO: | conditionals | 2 | Madhu | | |
+| 6.4 LO: | loops | 2 | Puneeth | | |
+| 6.5 LO: | Assessment | 3 | Anoop | | |
+|---------+----------------------------------------+-------+----------+-----------------+-----------|
+| 7.1 LO: | manipulating lists | 3 | Madhu | | |
+| 7.2 LO: | manipulating strings | 2 | Punch | | |
+| 7.3 LO: | getting started with tuples | 2 | Nishanth | | |
+| 7.4 LO: | dictionaries | 2 | Anoop | | |
+| 7.5 LO: | sets | 2 | Nishanth | | |
+| 7.6 LO: | Assessment | 3 | Amit | | |
+|---------+----------------------------------------+-------+----------+-----------------+-----------|
+| 8.1 LO: | getting started with functions | 3 | Nishanth | | |
+| 8.2 LO: | advanced features of functions | 3 | Punch | | |
+| 8.3 LO: | using python modules | 3 | Anoop | | |
+| 8.4 LO: | writing python scripts | 2 | Nishanth | | |
+| 8.5 LO: | testing and debugging | 2 | Amit | | |
+| 8.6 LO: | Assessment | 3 | Madhu | | |
+|---------+----------------------------------------+-------+----------+-----------------+-----------|
diff --git a/savefig/script.rst b/savefig/script.rst
index 87080d0..b2068cc 100644
--- a/savefig/script.rst
+++ b/savefig/script.rst
@@ -1,9 +1,24 @@
-.. 2.5 LO: saving plots (2)
-.. -------------------------
-.. * Outline
-.. + basic savefig
-.. + png, pdf, ps, eps, svg
-.. + going to OS and looking at the file
+.. Objectives
+.. ----------
+
+.. At the end of this tutorial, you will be able to
+
+.. 1. Saving plots using ``savefig()`` function.
+.. #. Saving plots in different formats.
+
+
+.. Prerequisites
+.. -------------
+
+.. 1. should have ``ipython`` and ``pylab`` installed.
+.. #. getting started with ``ipython``.
+.. #. using plot command interactively.
+
+.. Author : Anoop Jacob Thomas <anoop@fossee.in>
+ Internal Reviewer :
+ External Reviewer :
+ Checklist OK? : <put date stamp here, if OK> [2010-10-05]
+
=======
Savefig
@@ -134,8 +149,3 @@ plots in different formats and locating the files in the file system.
{{{ switch to Thank you slide }}}
Thank you!
-
-.. Author: Anoop Jacob Thomas <anoop@fossee.in>
- Reviewer 1:
- Reviewer 2:
- External reviewer:
diff --git a/statistics/quickref.tex b/statistics/quickref.tex
new file mode 100644
index 0000000..b26d168
--- /dev/null
+++ b/statistics/quickref.tex
@@ -0,0 +1,8 @@
+Creating a linear array:\\
+{\ex \lstinline| x = linspace(0, 2*pi, 50)|}
+
+Plotting two variables:\\
+{\ex \lstinline| plot(x, sin(x))|}
+
+Plotting two lists of equal length x, y:\\
+{\ex \lstinline| plot(x, y)|}
diff --git a/statistics.rst b/statistics/script.rst
index afe7e46..5398e21 100644
--- a/statistics.rst
+++ b/statistics/script.rst
@@ -28,7 +28,7 @@ all the elements and dividing by length of the list.::
sum function gives us the sum of the elements.::
- mean_using_sum=sum_age_list/len(age_list)
+ mean_using_sum=float(sum_age_list)/len(age_list)
This obviously gives the mean age but python has another
method for getting the mean. This is the mean function::
@@ -48,13 +48,15 @@ as if it was a single list of elements ::
flattened_seq=[1,5,6,8,1,3,4,5]
mean(flattened_seq)
-As you can see both the results are same. The other is mean
+As you can see both the results are same. The other way is mean
of each column.::
mean(two_dimension,0)
array([ 1. , 4. , 5. , 6.5])
-or along the two rows seperately.::
+we pass an extra argument 0 in that case.
+
+In case of getting mean along the rows the argument is 1::
mean(two_dimension,1)
array([ 5. , 3.25])
@@ -69,9 +71,16 @@ using the functions median and std::
median(age_list)
std(age_list)
+Median and std can also be calculated for two dimensional arrays along columns and rows just like mean.
-
-Now lets apply this to a real world example ::
+ For example ::
+
+ median(two_dimension,0)
+ std(two_dimension,1)
+
+This gives us the median along the colums and standard devition along the rows.
+
+Now lets apply this to a real world example
We will a data file that is at the a path
``/home/fossee/sslc2.txt``.It contains record of students and their
@@ -124,7 +133,7 @@ Standard deviation. ::
Now lets try and and get the mean for all the subjects ::
- L=loadtxt('sslc2.txt',usecols=(3,4,5,6,7),delimiter=';')
+ L=loadtxt('/home/fossee/sslc2.txt',usecols=(3,4,5,6,7),delimiter=';')
mean(L,0)
array([ 73.55452504, 53.79828941, 62.83342759, 50.69806158, 63.17056881])
diff --git a/statistics/slides.org b/statistics/slides.org
new file mode 100644
index 0000000..d4a5548
--- /dev/null
+++ b/statistics/slides.org
@@ -0,0 +1,33 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\useoutertheme{infolines}\usecolortheme{default}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+#+OPTIONS: H:5 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
+
+#+TITLE: Statistics
+#+AUTHOR: FOSSEE
+#+DATE: 2010-09-14 Tue
+#+EMAIL: info@fossee.in
+
+# \author[FOSSEE] {FOSSEE}
+
+# \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
+# \date{}
+
+* Tutorial Plan
+** Doing simple statistical operations in Python
+** Using loadtxt to solve statistics problem
+
+* Summary
+** seq=[1,5,6,8,1,3,4,5]
+** sum(seq)
+** mean(seq)
+** median(seq)
+** std(seq)
+
+* Summary
+
+** loadtxt
diff --git a/statistics/slides.tex b/statistics/slides.tex
new file mode 100644
index 0000000..df1462c
--- /dev/null
+++ b/statistics/slides.tex
@@ -0,0 +1,106 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%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}
+\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{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}
+\date{}
+
+% DOCUMENT STARTS
+\begin{document}
+
+\begin{frame}
+ \maketitle
+\end{frame}
+
+\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}
+\end{frame}
+
+\end{document}
diff --git a/symbolics/quickref.tex b/symbolics/quickref.tex
new file mode 100644
index 0000000..b26d168
--- /dev/null
+++ b/symbolics/quickref.tex
@@ -0,0 +1,8 @@
+Creating a linear array:\\
+{\ex \lstinline| x = linspace(0, 2*pi, 50)|}
+
+Plotting two variables:\\
+{\ex \lstinline| plot(x, sin(x))|}
+
+Plotting two lists of equal length x, y:\\
+{\ex \lstinline| plot(x, y)|}
diff --git a/symbolics.rst b/symbolics/script.rst
index 0bf9957..8539898 100644
--- a/symbolics.rst
+++ b/symbolics/script.rst
@@ -1,8 +1,8 @@
Symbolics with Sage
-------------------
-This tutorial on using Sage for symbolic calculation is brought to you
-by Fossee group.
+Hello friends and welcome to the tutorial on symbolics with sage.
+
.. #[Madhu: Sounds more or less like an ad!]
@@ -56,7 +56,7 @@ Now if you type::
sin(y)
- sage simply returns the expression .
+ sage simply returns the expression .
.. #[Madhu: Why is this line indented? Also full stop. When will you
learn? Yes we can correct you. But corrections are for you to
diff --git a/symbolics/slides.tex b/symbolics/slides.tex
new file mode 100644
index 0000000..df1462c
--- /dev/null
+++ b/symbolics/slides.tex
@@ -0,0 +1,106 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%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}
+\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{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}
+\date{}
+
+% DOCUMENT STARTS
+\begin{document}
+
+\begin{frame}
+ \maketitle
+\end{frame}
+
+\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}
+\end{frame}
+
+\end{document}
diff --git a/using python modules/script.rst b/using python modules/script.rst
index aa00863..e3190fd 100644
--- a/using python modules/script.rst
+++ b/using python modules/script.rst
@@ -1,11 +1,27 @@
-.. 9.3 LO: using python modules (3)
-.. ---------------------------------
-.. * executing python scripts from command line
-.. * import
-.. * scipy
-.. * pylab
-.. * sys
-.. * STDLIB modules show off
+.. Objectives
+.. ----------
+
+.. At the end of this tutorial, you will be able to
+
+.. 1. Execute python scripts from command line.
+.. #. Use import in scripts.
+.. #. Import scipy and pylab modules
+.. #. Use python standard modules and 3rd party modules.
+
+
+.. Prerequisites
+.. -------------
+
+.. 1. should have ``pylab`` installed.
+.. #. using plot command interactively.
+.. #. embellishing a plot.
+.. #. saving plots.
+
+.. Author : Anoop Jacob Thomas <anoop@fossee.in>
+ Internal Reviewer :
+ External Reviewer :
+ Checklist OK? : <put date stamp here, if OK> [2010-10-05]
+
====================
Using Python modules
@@ -17,7 +33,8 @@ Welcome to the spoken tutorial on using python modules.
{{{ switch to next slide, outline slide }}}
In this tutorial, we will see how to run python scripts from command
-line, importing modules, importing scipy and pylab modules.
+line, importing modules, importing scipy and pylab modules. And also
+see the Python standard library.
{{{ switch to next slide on executing python scripts from command line }}}
@@ -48,6 +65,8 @@ terminal and navigate to the directory where hello.py is,
{{{ open terminal and navigate to directory where hello.py was saved }}}
+{{{ switch to next slide }}}
+
now run the Python script as,
::
@@ -59,6 +78,8 @@ It executed the script and we got the output ``Hello World!``.
The syntax is python space filename.
+{{{ switch to next slide, four plot problem }}}
+
Now recall the four plot problem where we plotted four plots in a single
figure. Let us run that script from command line.
@@ -87,6 +108,8 @@ starts. And thus we don't have to explicitly import modules.
So now let us try to fix the problem and run the script in command
line,
+{{{ switch to next slide, fix ``linspace`` problem }}}
+
add the following line as the first line in the script,
{{{ add the line as first line in four_plot.py and save }}}
::
@@ -100,6 +123,9 @@ Now let us run the script again,
Now it gave another error plot not defined, let us edit the file again
and add the line below the line we just added,
+
+{{{ switch to next slide, fix ``plot`` problem }}}
+
{{{ add the line as second line in four_plot.py and save }}}
::
@@ -115,6 +141,8 @@ Yes! it worked. So what did we do?
We actually imported the required modules using the keyword ``import``.
It could have also be done as,
+{{{ switch to next slide, better way of fixing }}}
+
{{{ highlight the following in slide and say it loud }}}
::
@@ -130,29 +158,26 @@ asterisk or star. As if we use asterisk to import from a particular
module then it will replace any existing functions with the same name
in our name-space.
+{{{ switch to next slide, Instead of ``*`` }}}
+
So let us modify four_plot.py as,
{{{ delete the first two lines and add the following }}}
::
from scipy import linspace, pi, sin
- from pylab import plot, legend, annotate, title, show
- from pylab import xlim, ylim
+ from pylab import plot, legend, annotate
+ from pylab import xlim, ylim, title, show
-{{{ switch to next slide }}}
-it could also be done as,
+Now let us try running the code again as,
+::
-.. import scipy
-.. import pylab
-.. x = scipy.linspace(-5*scipy.pi, 5*scipy.pi, 500)
-.. pylab.plot(x, x, 'b')
-.. pylab.plot(x, -x, 'b')
-.. pylab.plot(x, scipy.sin(x), 'g', linewidth=2)
-.. pylab.plot(x, x*scipy.sin(x), 'r', linewidth=3)
-.. pylab.legend(['x', '-x', 'sin(x)', 'xsin(x)'])
-.. pylab.annotate('origin', xy = (0, 0))
-.. pylab.xlim(-5*scipy.pi, 5*scipy.pi)
-.. pylab.ylim(-5*scipy.pi, 5*scipy.pi)
+ python four_plot.py
+It works! In this method we actually imported the functions to the
+current name-space, and there is another method of doing it. And that
+is,
+
+{{{ switch to next slide }}}
Notice that we use ``scipy.pi`` instead of just ``pi`` as in the
previous method, and the functions are called as ``pylab.plot()`` and
@@ -211,7 +236,7 @@ Find more information at Python Library reference,
The modules pylab, scipy, Mayavi are not part of the standard python
library.
-{{{ switch to next slide, recap }}}
+{{{ switch to next slide, summary }}}
This brings us to the end of this tutorial, in this tutorial we
learned running scripts from command line, learned about modules, saw
@@ -220,8 +245,3 @@ the python standard library.
{{{ switch to next slide, thank you slide }}}
Thank you!
-
-.. Author: Anoop Jacob Thomas <anoop@fossee.in>
- Reviewer 1:
- Reviewer 2:
- External reviewer:
diff --git a/using python modules/slides.org b/using python modules/slides.org
new file mode 100644
index 0000000..46f6dc9
--- /dev/null
+++ b/using python modules/slides.org
@@ -0,0 +1,125 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+
+#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
+#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
+
+#+LaTeX_HEADER: \usepackage{listings}
+
+#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
+#+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
+#+LaTeX_HEADER: showstringspaces=false, keywordstyle=\color{blue}\bfseries}
+
+#+TITLE: Using python modules
+#+AUTHOR: FOSSEE
+#+EMAIL:
+#+DATE:
+
+#+DESCRIPTION:
+#+KEYWORDS:
+#+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
+
+* Outline
+ - Running python scripts from command line
+ - Importing python modules
+ - Importing scipy \& pylab modules
+ - About python standard library.
+* Running Python script from command line
+ - Create a script, open text editor and type the following
+ : print "hello world!"
+ : print
+ - Save the script as ~hello.py~
+* Running Python script from command line (cont'd)
+ - Run the script
+ : $ python hello.py
+ /Syntax :/ *python filename*
+* Four plot problem
+ #+begin_latex
+ \begin{center}
+ \includegraphics[scale=0.4]{four_plot}
+ \end{center}
+ #+end_latex
+* Fix ~linspace()~ problem
+ : from scipy import *
+* Fix ~plot()~ problem
+ : from pylab import *
+* Better way of fixing
+ : from scipy import linspace
+ instead of
+ : from scipy import *
+ ~*~ means import all functions from name-space ~scipy~.
+* Instead of ~*~
+ : from scipy import linspace, pi, sin
+ : from pylab import plot, legend, annotate
+ : from pylab import xlim, ylim, title, show
+ Is better than, ~from scipy import *~ \& ~from pylab import *~.
+* Another Fix
+ #+begin_src python
+ import scipy
+ import pylab
+ x = scipy.linspace(-5*scipy.pi, 5*scipy.pi, 500)
+ pylab.plot(x, x, 'b')
+ pylab.plot(x, -x, 'b')
+ pylab.plot(x, scipy.sin(x), 'g', linewidth=2)
+ pylab.plot(x, x*scipy.sin(x), 'r', linewidth=3)
+ pylab.legend(['x', '-x', 'sin(x)', 'xsin(x)'])
+ pylab.annotate('origin', xy = (0, 0))
+ pylab.xlim(-5*scipy.pi, 5*scipy.pi)
+ pylab.ylim(-5*scipy.pi, 5*scipy.pi)
+ #+end_src
+* Exercise 1
+ Write a python script to plot a sine wave from
+ #+begin_latex
+ $-2\Pi$
+ #+end_latex
+ to
+ #+begin_latex
+ $2\Pi$
+ #+end_latex
+ .
+* What is a module?
+ Module is simply a file containing Python definitions and
+ statements. Definitions from a module can be imported into other
+ modules or into the main module.
+* Python standard library
+ Python has a very rich standard library of modules.
+ - Few libraries
+ - Math: ~math~, ~random~
+ - Internet access: ~urllib2~, ~smtplib~
+ - System, Command line arguments: ~sys~
+ - Operating system interface: ~os~
+ - regular expressions: ~re~
+ - compression: ~gzip~, ~zipfile~, ~tarfile~
+ - More information
+ - [[http://docs.python.org/library]]
+* Summary
+ - Running scripts from command line
+ - Learned about modules
+ - importing modules
+ - Python standard library
+* Thank you!
+#+begin_latex
+ \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_latex
+
+
diff --git a/using python modules/slides.tex b/using python modules/slides.tex
new file mode 100644
index 0000000..08c954b
--- /dev/null
+++ b/using python modules/slides.tex
@@ -0,0 +1,227 @@
+% Created 2010-10-12 Tue 17:12
+\documentclass[presentation]{beamer}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\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
+\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}}
+
+\title{Using python modules}
+\author{FOSSEE}
+\date{}
+
+\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+\begin{document}
+
+\maketitle
+
+
+
+
+
+
+
+
+
+\begin{frame}
+\frametitle{Outline}
+\label{sec-1}
+
+\begin{itemize}
+\item Running python scripts from command line
+\item Importing python modules
+\item Importing scipy \& pylab modules
+\item About python standard library.
+\end{itemize}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Running Python script from command line}
+\label{sec-2}
+
+\begin{itemize}
+\item Create a script, open text editor and type the following
+\begin{verbatim}
+ print "hello world!"
+ print
+\end{verbatim}
+
+\item Save the script as \texttt{hello.py}
+\end{itemize}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Running Python script from command line (cont'd)}
+\label{sec-3}
+
+\begin{itemize}
+\item Run the script
+\begin{verbatim}
+ $ python hello.py
+\end{verbatim}
+
+\end{itemize}
+
+ \emph{Syntax :} \textbf{python filename}
+\end{frame}
+\begin{frame}
+\frametitle{Four plot problem}
+\label{sec-4}
+
+ \begin{center}
+ \includegraphics[scale=0.4]{four_plot}
+ \end{center}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Fix \texttt{linspace()} problem}
+\label{sec-5}
+
+\begin{verbatim}
+ from scipy import *
+\end{verbatim}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Fix \texttt{plot()} problem}
+\label{sec-6}
+
+\begin{verbatim}
+ from pylab import *
+\end{verbatim}
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Better way of fixing}
+\label{sec-7}
+
+\begin{verbatim}
+ from scipy import linspace
+\end{verbatim}
+
+ instead of
+\begin{verbatim}
+ from scipy import *
+\end{verbatim}
+
+ \texttt{*} means import all functions from name-space \texttt{scipy}.
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Instead of \texttt{*}}
+\label{sec-8}
+
+\begin{verbatim}
+ from scipy import linspace, pi, sin
+ from pylab import plot, legend, annotate
+ from pylab import xlim, ylim, title, show
+\end{verbatim}
+
+ Is better than, \texttt{from scipy import *} \& \texttt{from pylab import *}.
+\end{frame}
+\begin{frame}[fragile]
+\frametitle{Another Fix}
+\label{sec-9}
+
+\begin{verbatim}
+import scipy
+import pylab
+x = scipy.linspace(-5*scipy.pi, 5*scipy.pi, 500)
+pylab.plot(x, x, 'b')
+pylab.plot(x, -x, 'b')
+pylab.plot(x, scipy.sin(x), 'g', linewidth=2)
+pylab.plot(x, x*scipy.sin(x), 'r', linewidth=3)
+pylab.legend(['x', '-x', 'sin(x)', 'xsin(x)'])
+pylab.annotate('origin', xy = (0, 0))
+pylab.xlim(-5*scipy.pi, 5*scipy.pi)
+pylab.ylim(-5*scipy.pi, 5*scipy.pi)
+\end{verbatim}
+\end{frame}
+\begin{frame}
+\frametitle{Exercise 1}
+\label{sec-10}
+
+ Write a python script to plot a sine wave from
+ $-2\Pi$
+ to
+ $2\Pi$
+ .
+\end{frame}
+\begin{frame}
+\frametitle{What is a module?}
+\label{sec-11}
+
+ Module is simply a file containing Python definitions and
+ statements. Definitions from a module can be imported into other
+ modules or into the main module.
+\end{frame}
+\begin{frame}
+\frametitle{Python standard library}
+\label{sec-12}
+
+ Python has a very rich standard library of modules.
+\begin{itemize}
+\item Few libraries
+
+\begin{itemize}
+\item Math: \texttt{math}, \texttt{random}
+\item Internet access: \texttt{urllib2}, \texttt{smtplib}
+\item System, Command line arguments: \texttt{sys}
+\item Operating system interface: \texttt{os}
+\item regular expressions: \texttt{re}
+\item compression: \texttt{gzip}, \texttt{zipfile}, \texttt{tarfile}
+\end{itemize}
+
+\item More information
+
+\begin{itemize}
+\item \href{http://docs.python.org/library}{http://docs.python.org/library}
+\end{itemize}
+
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{Summary}
+\label{sec-13}
+
+\begin{itemize}
+\item Running scripts from command line
+\item Learned about modules
+
+\begin{itemize}
+\item importing modules
+\end{itemize}
+
+\item Python standard library
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{Thank you!}
+\label{sec-14}
+
+ \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}
diff --git a/using-sage/script.rst b/using-sage/script.rst
index 351953b..6b33173 100644
--- a/using-sage/script.rst
+++ b/using-sage/script.rst
@@ -1,10 +1,29 @@
-========
- Script
-========
+.. Objectives
+.. ----------
+
+.. By the end of this tutorial you will --
+
+.. 1. Get an idea of the range of things for which Sage can be used.
+.. #. Know some of the functions for Calculus
+.. #. Get some insight into Graphs in Sage.
+
+
+.. Prerequisites
+.. -------------
+
+.. Getting Started -- Sage
+
+.. Author : Puneeth
+ Internal Reviewer :
+ External Reviewer :
+ Checklist OK? : <put date stamp here, if OK> [2010-10-05]
+
+Script
+------
{{{ show the welcome slide }}}
-Welcome to this tutorial on using Sage.
+Hello Friends. Welcome to this tutorial on using Sage.
{{{ show the slide with outline }}}
@@ -194,4 +213,8 @@ available in Sage.
We have looked at some of the functions available for Linear Algebra,
Calculus, Graph Theory and Number theory.
-Thank You!
+This tutorial was created as a part of FOSSEE project, NME ICT, MHRD India
+
+Hope you have enjoyed and found it useful.
+Thank you!
+
diff --git a/using-sage/slides.org b/using-sage/slides.org
new file mode 100644
index 0000000..b8b5f6e
--- /dev/null
+++ b/using-sage/slides.org
@@ -0,0 +1,60 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+
+#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
+#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
+
+#+LaTeX_HEADER: \usepackage{listings}
+
+#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
+#+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
+#+LaTeX_HEADER: showstringspaces=false, keywordstyle=\color{blue}\bfseries}
+
+#+TITLE: using Sage
+#+AUTHOR: FOSSEE
+#+EMAIL:
+#+DATE:
+
+#+DESCRIPTION:
+#+KEYWORDS:
+#+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
+
+* Outline
+ - Calculus
+ - Linear Algebra
+ - Graph Theory
+ - Number Theory
+* Summary
+ - Differentiating and Integrating
+ - Taylor Expansions
+ - Solving Equations
+ - Initializing Graphs & Graph families
+ - Prime numbers
+ - Factors
+ - Combinations & Permutations
+* Thank you!
+#+begin_latex
+ \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_latex
+
+
diff --git a/using-sage/slides.tex b/using-sage/slides.tex
index df1462c..d301f78 100644
--- a/using-sage/slides.tex
+++ b/using-sage/slides.tex
@@ -1,95 +1,74 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%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-10-11 Mon 22:48
+\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{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}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% 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}
+\lstset{language=Python, basicstyle=\ttfamily\bfseries,
+commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
+showstringspaces=false, keywordstyle=\color{blue}\bfseries}
+\providecommand{\alert}[1]{\textbf{#1}}
+
+\title{using Sage}
+\author{FOSSEE}
\date{}
-% DOCUMENT STARTS
+\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\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!}
+\frametitle{Outline}
+\label{sec-1}
+
+\begin{itemize}
+\item Calculus
+\item Linear Algebra
+\item Graph Theory
+\item Number Theory
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{Summary}
+\label{sec-2}
+
+\begin{itemize}
+\item Differentiating and Integrating
+\item Taylor Expansions
+\item Solving Equations
+\item Initializing Graphs \& Graph families
+\item Prime numbers
+\item Factors
+\item Combinations \& Permutations
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{Thank you!}
+\label{sec-3}
+
\begin{block}{}
\begin{center}
This spoken tutorial has been produced by the