summaryrefslogtreecommitdiff
path: root/day1/cheatsheet2.tex
diff options
context:
space:
mode:
authorSantosh G. Vattam2009-11-06 18:39:56 +0530
committerSantosh G. Vattam2009-11-06 18:39:56 +0530
commit359e82a186e0c7c99752e9c881b0820d8f0d9bfc (patch)
tree99782d7ce439cc4a4dee84c5b031628dad210d8b /day1/cheatsheet2.tex
parent5dff3c8fa7cf4b8ed79a89120da758b5d3020c9e (diff)
downloadworkshops-359e82a186e0c7c99752e9c881b0820d8f0d9bfc.tar.gz
workshops-359e82a186e0c7c99752e9c881b0820d8f0d9bfc.tar.bz2
workshops-359e82a186e0c7c99752e9c881b0820d8f0d9bfc.zip
Updated cheatsheet for session 2.
Diffstat (limited to 'day1/cheatsheet2.tex')
-rw-r--r--day1/cheatsheet2.tex32
1 files changed, 10 insertions, 22 deletions
diff --git a/day1/cheatsheet2.tex b/day1/cheatsheet2.tex
index 65ef411..9416a41 100644
--- a/day1/cheatsheet2.tex
+++ b/day1/cheatsheet2.tex
@@ -8,30 +8,18 @@
\LARGE{Plotting Data}\\
\large{FOSSEE}
\end{center}
-\section{Scripts}
-IPython History
-\begin{verbatim}
-In [1]: %hist
-In [2]: %hist -n
-\end{verbatim}
-
-Running a Script
-\begin{verbatim}
-In [3]: %run script_name.py
-\end{verbatim}
-
\section{Plotting from Data files}
\begin{verbatim}
-In [1]: L = [] #Empty List
-In [2]: T = []
-In [3]: for line in open('pendulum.txt'): # Opening & Reading files
- ....: points = line.split() # Splitting a string
- ....: L.append(float(points[0])) # Appending to a list
- ....: T.append(float(points[1]))
-In [4]: TSq = []
-In [5]: for t in T: #Iterating through lists
- ....: TSq.append(t*t)
-In [6]: plot(L, TSq, '.') # Plotting points
+l = [] #Empty List
+t = []
+for line in open('pendulum.txt'): # Opening & Reading files
+ points = line.split() # Splitting a string
+ l.append(float(points[0])) # Appending to a list
+ t.append(float(points[1]))
+tsq = []
+for time in t: #Iterating through lists
+ tsq.append(t*t)
+plot(l, tsq, '.') # Plotting points
\end{verbatim}
\end{document}