summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--day1/session5.tex12
1 files changed, 4 insertions, 8 deletions
diff --git a/day1/session5.tex b/day1/session5.tex
index 46dcd54..24b1282 100644
--- a/day1/session5.tex
+++ b/day1/session5.tex
@@ -134,9 +134,8 @@
\item Each row must have same number of values.
\end{itemize}
\begin{lstlisting}
-In []: data = loadtxt('pendulum.txt')
-In []: L = data[:,0]
-In []: T = data[:,1]
+In []: L, T = loadtxt('pendulum.txt',
+ unpack = True)
\end{lstlisting}
\end{frame}
@@ -154,11 +153,8 @@ In []: T = data[:,1]
%% \item Interpolate the missing region.
\end{itemize}
\begin{lstlisting}
-In []: data = loadtxt('points.txt')
-In []: data.shape
-Out[]: (40, 2)
-In []: x = data[:,0]
-In []: y = data[:,1]
+In []: x, y = loadtxt('points.txt',
+ unpack = True)
In []: plot(x, y, '.')
\end{lstlisting}
\end{frame}