diff options
Diffstat (limited to 'scipy/basic/session3.tex')
-rw-r--r-- | scipy/basic/session3.tex | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/scipy/basic/session3.tex b/scipy/basic/session3.tex index 2de9b05..c53cc41 100644 --- a/scipy/basic/session3.tex +++ b/scipy/basic/session3.tex @@ -666,108 +666,3 @@ In []: colorbar() \end{frame} \end{document} - -%% Questions for Quiz %% -%% ------------------ %% - -\begin{frame}[fragile] -\frametitle{\incqno } -\begin{lstlisting} -In []: a = array([[1, 2], - [3, 4]]) -In []: a[1,0] = 0 -\end{lstlisting} -What is the resulting array? -\end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } -\begin{lstlisting} - In []: x = array(([1,2,3,4], - [2,3,4,5])) - In []: x[-2][-3] = 4 - In []: print x -\end{lstlisting} -What will be printed? -\end{frame} - -%% \begin{frame}[fragile] -%% \frametitle{\incqno } -%% \begin{lstlisting} -%% In []: x = array([[1,2,3,4], -%% [3,4,2,5]]) -%% \end{lstlisting} -%% What is the \lstinline+shape+ of this array? -%% \end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } -\begin{lstlisting} - In []: x = array([[1,2,3,4]]) -\end{lstlisting} -How to change \lstinline+x+ to \lstinline+array([[1,2,0,4]])+? -\end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } -\begin{lstlisting} - In []: x = array([[1,2,3,4], - [3,4,2,5]]) -\end{lstlisting} -How do you get the following slice of \lstinline+x+? -\begin{lstlisting} -array([[2,3], - [4,2]]) -\end{lstlisting} -\end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } -\begin{lstlisting} - In []: x = array([[9,18,27], - [30,60,90], - [14,7,1]]) -\end{lstlisting} -What is the output of \lstinline+x[::3,::3]+ -\end{frame} - - -\begin{frame}[fragile] -\frametitle{\incqno } -\begin{lstlisting} -In []: a = array([[1, 2], - [3, 4]]) -\end{lstlisting} -How do you get the transpose of this array? -\end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } -\begin{lstlisting} -In []: a = array([[1, 2], - [3, 4]]) -In []: b = array([[1, 1], - [2, 2]]) -In []: a*b -\end{lstlisting} -What does this produce? -\end{frame} - -\begin{frame} -\frametitle{\incqno } -What command do you use to find the inverse of a matrix and its -eigenvalues? -\end{frame} - -%% \begin{frame} -%% \frametitle{\incqno } -%% The file \lstinline+datafile.txt+ contains 3 columns of data. What -%% command will you use to read the entire data file into an array? -%% \end{frame} - -%% \begin{frame} -%% \frametitle{\incqno } -%% If the contents of the file \lstinline+datafile.txt+ is read into an -%% $N\times3$ array called \lstinline+data+, how would you obtain the third -%% column of this data? -%% \end{frame} |