|
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
2 %Tutorial slides on Python. |
|
3 % |
|
4 % Author: FOSSEE |
|
5 % Copyright (c) 2009, FOSSEE, IIT Bombay |
|
6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
7 |
|
8 \documentclass[14pt,compress]{beamer} |
|
9 %\documentclass[draft]{beamer} |
|
10 %\documentclass[compress,handout]{beamer} |
|
11 %\usepackage{pgfpages} |
|
12 %\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm] |
|
13 |
|
14 % Modified from: generic-ornate-15min-45min.de.tex |
|
15 \mode<presentation> |
|
16 { |
|
17 \usetheme{Warsaw} |
|
18 \useoutertheme{infolines} |
|
19 \setbeamercovered{transparent} |
|
20 } |
|
21 |
|
22 \usepackage[english]{babel} |
|
23 \usepackage[latin1]{inputenc} |
|
24 %\usepackage{times} |
|
25 \usepackage[T1]{fontenc} |
|
26 |
|
27 % Taken from Fernando's slides. |
|
28 \usepackage{ae,aecompl} |
|
29 \usepackage{mathpazo,courier,euler} |
|
30 \usepackage[scaled=.95]{helvet} |
|
31 |
|
32 \definecolor{darkgreen}{rgb}{0,0.5,0} |
|
33 |
|
34 \usepackage{listings} |
|
35 \lstset{language=Python, |
|
36 basicstyle=\ttfamily\bfseries, |
|
37 commentstyle=\color{red}\itshape, |
|
38 stringstyle=\color{darkgreen}, |
|
39 showstringspaces=false, |
|
40 keywordstyle=\color{blue}\bfseries} |
|
41 |
|
42 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
43 % Macros |
|
44 \setbeamercolor{emphbar}{bg=blue!20, fg=black} |
|
45 \newcommand{\emphbar}[1] |
|
46 {\begin{beamercolorbox}[rounded=true]{emphbar} |
|
47 {#1} |
|
48 \end{beamercolorbox} |
|
49 } |
|
50 \newcounter{time} |
|
51 \setcounter{time}{0} |
|
52 \newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}} |
|
53 |
|
54 \newcommand{\typ}[1]{\lstinline{#1}} |
|
55 |
|
56 \newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}} } |
|
57 |
|
58 % Title page |
|
59 \title{Python for Scientific Computing : Large Scale Data Processing} |
|
60 |
|
61 \author[FOSSEE] {FOSSEE} |
|
62 |
|
63 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay} |
|
64 \date{} |
|
65 |
|
66 % DOCUMENT STARTS |
|
67 \begin{document} |
|
68 |
|
69 \begin{frame} |
|
70 \maketitle |
|
71 \end{frame} |
|
72 |
|
73 \begin{frame} |
|
74 \frametitle{About the Session} |
|
75 \begin{block}{Goal} |
|
76 We read and process large data file to solve a problem. |
|
77 \end{block} |
|
78 \begin{block}{Checklist} |
|
79 \begin{itemize} |
|
80 \item sslc.txt |
|
81 \end{itemize} |
|
82 \end{block} |
|
83 \end{frame} |
|
84 |
|
85 \begin{frame} |
|
86 \frametitle{Structure of the file} |
|
87 Understanding the structure of sslc1.txt |
|
88 \begin{itemize} |
|
89 \item Each line in the file has a student's details(record) |
|
90 \item Each record consists of fields separated by ';' |
|
91 \end{itemize} |
|
92 \emphbar{A;015162;JENIL T P;081;060;77;41;74;333;P;;} |
|
93 \end{frame} |
|
94 |
|
95 \begin{frame} |
|
96 \frametitle{Structure of the file \ldots} |
|
97 \emphbar{A;015163;JOSEPH RAJ S;083;042;47;AA;72;244;;;} |
|
98 Each record consists of: |
|
99 \begin{itemize} |
|
100 \item Region Code : 'A' |
|
101 \item Roll Number : '015163' |
|
102 \item Name : 'JOSEPH RAJ S' |
|
103 \item Marks of 5 subjects: English(083), Hindi(042), Maths(47), Science(AA), Social(72) |
|
104 \item Total marks : 244 |
|
105 \item Pass/Fail (P/F) : '' |
|
106 \item Withheld (W) : '' |
|
107 \end{itemize} |
|
108 \end{frame} |
|
109 |
|
110 \begin{frame} |
|
111 \frametitle{Statistical Analysis: Problem statement} |
|
112 1. Read the data supplied in the file \emph{sslc1.txt} and carry out the following: |
|
113 \begin{block}{} |
|
114 Draw a pie chart representing proportion of students who scored more than 90\% in each region in Science. |
|
115 \end{itemize} |
|
116 \end{frame} |
|
117 |
|
118 \begin{frame} |
|
119 \frametitle{Problem statement: explanation} |
|
120 \emphbar{Draw a pie chart representing proportion of students who scored more than 90\% in each region in Science.} |
|
121 \begin{columns} |
|
122 \column{5.25\textwidth} |
|
123 \hspace*{.5in} |
|
124 \includegraphics[height=2.6in, interpolate=true]{data/science} |
|
125 \column{0.8\textwidth} |
|
126 \end{columns} |
|
127 \end{frame} |
|
128 |
|
129 \begin{frame} |
|
130 \frametitle{Machinery Required} |
|
131 \begin{itemize} |
|
132 \item File reading |
|
133 \item Parsing |
|
134 \item Dictionaries |
|
135 \item Arrays |
|
136 \item Statistical operations |
|
137 \end{itemize} |
|
138 \end{frame} |
|
139 |
|
140 \begin{frame}[fragile] |
|
141 \frametitle{Summary} |
|
142 \begin{block}{lists} |
|
143 \begin{itemize} |
|
144 \item Creation. |
|
145 \item Appending. |
|
146 \item Iterating through list. |
|
147 \end{itemize} |
|
148 \end{block} |
|
149 \begin{block}{Data processing} |
|
150 \begin{itemize} |
|
151 \item In form of lists. |
|
152 \item Handling files. |
|
153 \item for loops |
|
154 \end{itemize} |
|
155 \end{block} |
|
156 \end{frame} |
|
157 |
|
158 \begin{frame} |
|
159 \frametitle{Thank you!} |
|
160 \begin{block}{} |
|
161 This session is part of \textcolor{blue}{FOSSEE} project funded by: |
|
162 \begin{center} |
|
163 \textcolor{blue}{NME through ICT from MHRD, Govt. of India}. |
|
164 \end{center} |
|
165 \end{block} |
|
166 \end{frame} |
|
167 |
|
168 \end{document} |