author | Puneeth Chaganti <punchagan@fossee.in> |
Tue, 27 Oct 2009 14:24:49 +0530 | |
changeset 199 | 85a799d90c6a |
parent 183 | b34c3a22d726 |
child 188 | 15f29c7fd925 |
permissions | -rw-r--r-- |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
2 |
%Tutorial slides on Python. |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
3 |
% |
153
dc0da25b788b
Minor edits to day2 session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
151
diff
changeset
|
4 |
% Author: FOSSEE |
dc0da25b788b
Minor edits to day2 session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
151
diff
changeset
|
5 |
% Copyright (c) 2009, FOSSEE, IIT Bombay |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
6 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
7 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
8 |
\documentclass[14pt,compress]{beamer} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
9 |
%\documentclass[draft]{beamer} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
10 |
%\documentclass[compress,handout]{beamer} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
11 |
%\usepackage{pgfpages} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
12 |
%\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm] |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
13 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
14 |
% Modified from: generic-ornate-15min-45min.de.tex |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
15 |
\mode<presentation> |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
16 |
{ |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
17 |
\usetheme{Warsaw} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
18 |
\useoutertheme{split} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
19 |
\setbeamercovered{transparent} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
20 |
} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
21 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
22 |
\usepackage[english]{babel} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
23 |
\usepackage[latin1]{inputenc} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
24 |
%\usepackage{times} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
25 |
\usepackage[T1]{fontenc} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
26 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
27 |
% Taken from Fernando's slides. |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
28 |
\usepackage{ae,aecompl} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
29 |
\usepackage{mathpazo,courier,euler} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
30 |
\usepackage[scaled=.95]{helvet} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
31 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
32 |
\definecolor{darkgreen}{rgb}{0,0.5,0} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
33 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
34 |
\usepackage{listings} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
35 |
\lstset{language=Python, |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
36 |
basicstyle=\ttfamily\bfseries, |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
37 |
commentstyle=\color{red}\itshape, |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
38 |
stringstyle=\color{darkgreen}, |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
39 |
showstringspaces=false, |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
40 |
keywordstyle=\color{blue}\bfseries} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
41 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
42 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
43 |
% Macros |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
44 |
\setbeamercolor{emphbar}{bg=blue!20, fg=black} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
45 |
\newcommand{\emphbar}[1] |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
46 |
{\begin{beamercolorbox}[rounded=true]{emphbar} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
47 |
{#1} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
48 |
\end{beamercolorbox} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
49 |
} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
50 |
\newcounter{time} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
51 |
\setcounter{time}{0} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
52 |
\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
53 |
|
130
8905a5badd7e
Minor edits to day1 session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
118
diff
changeset
|
54 |
\newcommand{\typ}[1]{\lstinline{#1}} |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
55 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
56 |
\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}} } |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
57 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
58 |
%%% This is from Fernando's setup. |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
59 |
% \usepackage{color} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
60 |
% \definecolor{orange}{cmyk}{0,0.4,0.8,0.2} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
61 |
% % Use and configure listings package for nicely formatted code |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
62 |
% \usepackage{listings} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
63 |
% \lstset{ |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
64 |
% language=Python, |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
65 |
% basicstyle=\small\ttfamily, |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
66 |
% commentstyle=\ttfamily\color{blue}, |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
67 |
% stringstyle=\ttfamily\color{orange}, |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
68 |
% showstringspaces=false, |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
69 |
% breaklines=true, |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
70 |
% postbreak = \space\dots |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
71 |
% } |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
72 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
73 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
74 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
75 |
% Title page |
183 | 76 |
\title[Plotting using Python]{Python for Science and Egg. Plotting experimental data} |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
77 |
|
153
dc0da25b788b
Minor edits to day2 session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
151
diff
changeset
|
78 |
\author[FOSSEE] {FOSSEE} |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
79 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
80 |
\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
81 |
\date[] {31, October 2009\\Day 1, Session 2} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
82 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
83 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
84 |
%\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
85 |
%\logo{\pgfuseimage{iitmlogo}} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
86 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
87 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
88 |
%% Delete this, if you do not want the table of contents to pop up at |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
89 |
%% the beginning of each subsection: |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
90 |
\AtBeginSubsection[] |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
91 |
{ |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
92 |
\begin{frame}<beamer> |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
93 |
\frametitle{Outline} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
94 |
\tableofcontents[currentsection,currentsubsection] |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
95 |
\end{frame} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
96 |
} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
97 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
98 |
\AtBeginSection[] |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
99 |
{ |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
100 |
\begin{frame}<beamer> |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
101 |
\frametitle{Outline} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
102 |
\tableofcontents[currentsection,currentsubsection] |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
103 |
\end{frame} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
104 |
} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
105 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
106 |
% If you wish to uncover everything in a step-wise fashion, uncomment |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
107 |
% the following command: |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
108 |
%\beamerdefaultoverlayspecification{<+->} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
109 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
110 |
%\includeonlyframes{current,current1,current2,current3,current4,current5,current6} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
111 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
112 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
113 |
% DOCUMENT STARTS |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
114 |
\begin{document} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
115 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
116 |
\begin{frame} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
117 |
\titlepage |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
118 |
\end{frame} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
119 |
|
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
120 |
\begin{frame} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
121 |
\frametitle{Outline} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
122 |
\tableofcontents |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
123 |
% You might wish to add the option [pausesections] |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
124 |
\end{frame} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
125 |
|
179
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
126 |
\begin{frame} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
127 |
\frametitle{Why we didn't close the IPython??} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
128 |
\begin{itemize} |
183 | 129 |
\item IPython provides a convenient feature |
130 |
\item To go back, edit, and re-run commands |
|
131 |
\item But when you close, this is lost |
|
179
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
132 |
\end{itemize} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
133 |
\end{frame} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
134 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
135 |
\begin{frame} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
136 |
\frametitle{But its impractical..} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
137 |
\begin{itemize} |
183 | 138 |
\item We can't keep running the IPython shell for days |
139 |
\item And its a pain to go back and edit |
|
179
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
140 |
\end{itemize} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
141 |
And the solution is..\\ |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
142 |
\begin{center} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
143 |
\alert {\typ{Scripts!!}} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
144 |
\end{center} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
145 |
\end{frame} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
146 |
|
183 | 147 |
\section{Scripts} |
151
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
148 |
\begin{frame}[fragile] |
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
149 |
\frametitle{Python Scripts} |
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
150 |
\begin{itemize} |
183 | 151 |
\item Put all commands used in review problem into a file. |
152 |
\item use hist command of IPython. |
|
151
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
153 |
\end{itemize} |
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
154 |
\begin{lstlisting} |
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
155 |
In []: %hist |
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
156 |
In []: %hist -n |
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
157 |
\end{lstlisting} |
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
158 |
\end{frame} |
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
159 |
|
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
160 |
\begin{frame} |
151
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
161 |
\frametitle{Python Scripts\ldots} |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
162 |
\begin{itemize} |
151
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
163 |
\item Open a new file in an \alert{editor} |
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
164 |
\item Copy and paste required lines from the output of \typ{\%hist -n} |
179
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
165 |
\item Save the file as \typ{sine_plot.py} |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
166 |
\end{itemize} |
151
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
167 |
\begin{itemize} |
179
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
168 |
\item run the file in IPython using \typ{\%run sine_plot.py}\\ |
151
55c22520ff5e
Added IPython history to Day1 Session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
146
diff
changeset
|
169 |
\end{itemize} |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
170 |
\end{frame} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
171 |
|
179
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
172 |
\begin{frame}[fragile] |
183 | 173 |
\frametitle{Why would I plot f(x)?} |
174 |
How often do we plot analytical functions?\\We plot experimental data more. |
|
179
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
175 |
\begin{lstlisting} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
176 |
In []: x = [0, 1, 2, 3] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
177 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
178 |
In []: y = [7, 11, 15, 19] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
179 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
180 |
In []: plot(x, y) |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
181 |
Out[]: [<matplotlib.lines.Line2D object at 0xa73aa8c>] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
182 |
\end{lstlisting} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
183 |
\end{frame} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
184 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
185 |
\begin{frame}[fragile] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
186 |
\frametitle{Plotting points} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
187 |
\begin{itemize} |
183 | 188 |
\item What if we want to plot the points! |
179
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
189 |
\end{itemize} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
190 |
\begin{lstlisting} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
191 |
In []: clf() |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
192 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
193 |
In []: plot(L, TSq, 'o') |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
194 |
Out[]: [<matplotlib.lines.Line2D object at 0xac17e0c>] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
195 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
196 |
In []: clf() |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
197 |
In []: plot(L, TSq, '.') |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
198 |
Out[]: [<matplotlib.lines.Line2D object at 0xac17e0c>] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
199 |
\end{lstlisting} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
200 |
\end{frame} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
201 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
202 |
\begin{frame}[fragile] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
203 |
\frametitle{Additional Plotting Attributes} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
204 |
\begin{itemize} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
205 |
\item \kwrd{'o'} - Dots |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
206 |
\item \kwrd{'.'} - Smaller Dots |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
207 |
\item \kwrd{'-'} - Lines |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
208 |
\item \kwrd{'- -'} - Dashed lines |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
209 |
\end{itemize} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
210 |
\end{frame} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
211 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
212 |
\section{Lists} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
213 |
\begin{frame}[fragile] |
183 | 214 |
\frametitle{How to create the data?} |
179
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
215 |
What are \typ{x} and \typ{y} here??\\ |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
216 |
\begin{center} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
217 |
\alert{\typ{lists!!}} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
218 |
\end{center} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
219 |
\begin{lstlisting} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
220 |
In []: mtlist = [] #Empty List |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
221 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
222 |
In []: lst = [1,2,3,4,5] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
223 |
\end{lstlisting} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
224 |
\end{frame} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
225 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
226 |
\begin{frame}[fragile] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
227 |
\frametitle{Accessing elements of a list} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
228 |
\begin{lstlisting} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
229 |
In []: lst[0]+lst[1]+lst[-1] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
230 |
Out[]: 7 |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
231 |
\end{lstlisting} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
232 |
\end{frame} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
233 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
234 |
\begin{frame}[fragile] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
235 |
\frametitle{List: Slicing} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
236 |
\alert{\typ{list[initial:final:step]}} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
237 |
\begin{lstlisting} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
238 |
In []: lst[1:3] # A slice. |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
239 |
Out[]: [2, 3] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
240 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
241 |
In []: lst[1:-1] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
242 |
Out[]: [2, 3] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
243 |
\end{lstlisting} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
244 |
\end{frame} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
245 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
246 |
\begin{frame}[fragile] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
247 |
\frametitle{List concatenation and list methods} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
248 |
\begin{lstlisting} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
249 |
In []: anthrlst = [6,7,8,9] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
250 |
In []: lnglst = lst + anthrlst |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
251 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
252 |
In []: lnglst |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
253 |
Out[]: [1, 2, 3, 4, 5, 6, 7, 8, 9] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
254 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
255 |
In []: lst.append(6) |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
256 |
In []: lst |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
257 |
Out[]: [1, 2, 3, 4, 5, 6] |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
258 |
\end{lstlisting} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
259 |
%\inctime{10} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
260 |
\end{frame} |
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
261 |
|
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
262 |
\section{Simple Pendulum} |
153
dc0da25b788b
Minor edits to day2 session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
151
diff
changeset
|
263 |
\begin{frame}[fragile] |
dc0da25b788b
Minor edits to day2 session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
151
diff
changeset
|
264 |
\frametitle{Simple Pendulum - L and T} |
179
eea01ca072ff
Updated session 2.tex of Day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
163
diff
changeset
|
265 |
Let us look at a more realistic example of the Simple Pendulum experiment. |
153
dc0da25b788b
Minor edits to day2 session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
151
diff
changeset
|
266 |
\end{frame} |
dc0da25b788b
Minor edits to day2 session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
151
diff
changeset
|
267 |
|
dc0da25b788b
Minor edits to day2 session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
151
diff
changeset
|
268 |
\begin{frame}[fragile] |
156
6a1388c456f4
Added plotting of points, additional attributes of plots.
Puneeth Chaganti <punchagan@fossee.in>
parents:
153
diff
changeset
|
269 |
\frametitle{Plotting $L$ vs. $T^2$} |
6a1388c456f4
Added plotting of points, additional attributes of plots.
Puneeth Chaganti <punchagan@fossee.in>
parents:
153
diff
changeset
|
270 |
\begin{itemize} |
6a1388c456f4
Added plotting of points, additional attributes of plots.
Puneeth Chaganti <punchagan@fossee.in>
parents:
153
diff
changeset
|
271 |
\item We must square each of the values in T |
6a1388c456f4
Added plotting of points, additional attributes of plots.
Puneeth Chaganti <punchagan@fossee.in>
parents:
153
diff
changeset
|
272 |
\item How to do it? |
6a1388c456f4
Added plotting of points, additional attributes of plots.
Puneeth Chaganti <punchagan@fossee.in>
parents:
153
diff
changeset
|
273 |
\item T is a \kwrd{list} and we use a \kwrd{for} loop to iterate over it |
6a1388c456f4
Added plotting of points, additional attributes of plots.
Puneeth Chaganti <punchagan@fossee.in>
parents:
153
diff
changeset
|
274 |
\end{itemize} |
6a1388c456f4
Added plotting of points, additional attributes of plots.
Puneeth Chaganti <punchagan@fossee.in>
parents:
153
diff
changeset
|
275 |
\end{frame} |
153
dc0da25b788b
Minor edits to day2 session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
151
diff
changeset
|
276 |
|
159
01f57cda252f
Manual merge of conflicting branches.
Santosh G. Vattam <vattam.santosh@gmail.com>
diff
changeset
|
277 |
\begin{frame}[fragile] |
01f57cda252f
Manual merge of conflicting branches.
Santosh G. Vattam <vattam.santosh@gmail.com>
diff
changeset
|
278 |
\frametitle{Plotting $L$ vs $T^2$} |
158
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
279 |
\begin{lstlisting} |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
280 |
In []: TSq = [] |
153
dc0da25b788b
Minor edits to day2 session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
151
diff
changeset
|
281 |
|
158
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
282 |
In []: for t in T: |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
283 |
....: TSq.append(t*t) |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
284 |
|
162
1af425d33eba
Removed L vs T plotting from session 2 day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
161
diff
changeset
|
285 |
In []: plot(L, TSq) |
158
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
286 |
Out[]: [<matplotlib.lines.Line2D object at 0xa5b05ac>] |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
287 |
\end{lstlisting} |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
288 |
\end{frame} |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
289 |
|
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
290 |
|
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
291 |
\begin{frame}[fragile] |
183 | 292 |
\frametitle{More of \texttt{for}} |
158
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
293 |
Used to iterate over lists\\ Let us look at another example. |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
294 |
\begin{lstlisting} |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
295 |
In []: lst = [1,2,3,4,5,6] |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
296 |
In []: for num in lst: |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
297 |
....: print num, num*num |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
298 |
....: |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
299 |
1 1 |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
300 |
2 4 |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
301 |
3 9 |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
302 |
4 16 |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
303 |
5 25 |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
304 |
6 36 |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
305 |
\end{lstlisting} |
978108b0c02c
Added lists and for slides to session 2, day 1.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
153
diff
changeset
|
306 |
\end{frame} |
153
dc0da25b788b
Minor edits to day2 session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
151
diff
changeset
|
307 |
|
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
308 |
\begin{frame}[fragile] |
161
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
309 |
\frametitle{Reading pendulum.txt} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
310 |
\begin{itemize} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
311 |
\item We now wish to repeat the plot using the values from a file |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
312 |
\item Given a file containing L vs. T values |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
313 |
\item Column1 - L; Column2 - T |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
314 |
\item Read the file |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
315 |
\item Plot points for L vs. $T^2$ |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
316 |
\end{itemize} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
317 |
\end{frame} |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
318 |
|
161
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
319 |
\begin{frame}[fragile] |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
320 |
\frametitle{Reading pendulum.txt} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
321 |
\begin{lstlisting} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
322 |
In []: L = [] |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
323 |
In []: T = [] |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
324 |
In []: for line in open('pendulum.txt'): |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
325 |
.... points = line.split() |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
326 |
.... L.append(float(points[0])) |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
327 |
.... T.append(float(points[1])) |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
328 |
\end{lstlisting} |
161
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
329 |
\begin{itemize} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
330 |
\item We now have two lists L and T |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
331 |
\item Now, Repeat previous steps for plotting |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
332 |
\end{itemize} |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
333 |
\end{frame} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
334 |
|
161
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
335 |
\begin{frame}[fragile] |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
336 |
\frametitle{Plotting from pendulum.txt} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
337 |
\begin{lstlisting} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
338 |
In []: TSq = [] |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
339 |
|
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
340 |
In []: for t in T: |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
341 |
....: TSq.append(t*t) |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
342 |
|
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
343 |
In []: plot(L, TSq, '.') |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
344 |
\end{lstlisting} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
345 |
\end{frame} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
346 |
|
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
347 |
\begin{frame}{New Concepts} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
348 |
\begin{itemize} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
349 |
\item File handling |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
350 |
\item Strings |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
351 |
\item Data-type conversion |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
352 |
\end{itemize} |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
353 |
\end{frame} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
354 |
|
161
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
355 |
\begin{frame}[fragile] |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
356 |
\frametitle{Reading files \ldots} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
357 |
\typ{In []: for line in open('pendulum.txt'):} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
358 |
\begin{itemize} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
359 |
\item opening file `pendulum.txt' |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
360 |
\item iterating through file using variable \typ{line} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
361 |
\item \typ{line} is a \kwrd{string} variable |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
362 |
\end{itemize} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
363 |
\end{frame} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
364 |
|
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
365 |
\begin{frame}[fragile] |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
366 |
\frametitle{Strings} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
367 |
Anything within ``quotes'' is a string! |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
368 |
\begin{lstlisting} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
369 |
' This is a string ' |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
370 |
" This too! " |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
371 |
""" This one too! """ |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
372 |
''' And one more! ''' |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
373 |
\end{lstlisting} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
374 |
\end{frame} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
375 |
|
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
376 |
\begin{frame}[fragile] |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
377 |
\frametitle{Strings and \typ{split()}} |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
378 |
\begin{lstlisting} |
161
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
379 |
In []: line = 'hello world' |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
380 |
|
163
f7aeeedb9aa3
Minor correction to session 2 day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
162
diff
changeset
|
381 |
In []: line.split() |
130
8905a5badd7e
Minor edits to day1 session2.
Puneeth Chaganti <punchagan@fossee.in>
parents:
118
diff
changeset
|
382 |
Out[]: ['hello', 'world'] |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
383 |
\end{lstlisting} |
161
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
384 |
This is what happens with \typ{line} |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
385 |
\begin{lstlisting} |
161
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
386 |
In []: line = '1.2000e-01 7.4252e-01' |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
387 |
|
161
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
388 |
In []: line.split() |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
389 |
Out[]: ['1.2000e-01', '7.4252e-01'] |
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
390 |
\end{lstlisting} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
391 |
\end{frame} |
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
392 |
|
161
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
393 |
\begin{frame}[fragile] |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
394 |
\frametitle{Getting floats from strings} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
395 |
\begin{lstlisting} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
396 |
In []: type(points[0]) |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
397 |
Out[]: <type 'str'> |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
398 |
\end{lstlisting} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
399 |
But, we need floating point numbers |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
400 |
\begin{lstlisting} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
401 |
In []: t = float(point[0]) |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
402 |
|
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
403 |
In []: type(t) |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
404 |
Out[]: <type 'float'> |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
405 |
\end{lstlisting} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
406 |
\end{frame} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
407 |
|
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
408 |
\begin{frame}[fragile] |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
409 |
\begin{figure} |
162
1af425d33eba
Removed L vs T plotting from session 2 day 1 slides.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
161
diff
changeset
|
410 |
%\includegraphics[width=3.5in]{data/L-Tsq.png} |
161
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
411 |
\end{figure} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
412 |
\vspace{-0.2in} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
413 |
Coming up - \alert{Least Square Fit \ldots} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
414 |
\end{frame} |
ff22fae4fde5
Adding reading files and plotting to day1 session1.
Puneeth Chaganti <punchagan@fossee.in>
parents:
160
diff
changeset
|
415 |
|
109
16e04782baac
Added session2.tex.
Santosh G. Vattam <vattam.santosh@gmail.com>
parents:
diff
changeset
|
416 |
\end{document} |