diff options
author | Prabhu Ramachandran | 2017-01-18 23:41:05 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2017-01-18 23:41:05 +0530 |
commit | cd46d964d97d0a0fa5479247335f14ead6ec3d69 (patch) | |
tree | 7d9298c6e67c6b5c2f1059190cf155ed60d7ecb4 /scipy | |
parent | 06b2b7ab01915b3cb980f67f822851e68a44c3a3 (diff) | |
download | python-workshops-cd46d964d97d0a0fa5479247335f14ead6ec3d69.tar.gz python-workshops-cd46d964d97d0a0fa5479247335f14ead6ec3d69.tar.bz2 python-workshops-cd46d964d97d0a0fa5479247335f14ead6ec3d69.zip |
Remove irrelevant parts.
Diffstat (limited to 'scipy')
-rw-r--r-- | scipy/basic/session1a.tex | 52 | ||||
-rw-r--r-- | scipy/basic/session1b.tex | 52 | ||||
-rw-r--r-- | scipy/basic/session2a.tex | 54 | ||||
-rw-r--r-- | scipy/basic/session2b.tex | 54 | ||||
-rw-r--r-- | scipy/basic/session3.tex | 105 | ||||
-rw-r--r-- | scipy/basic/session4.tex | 126 |
6 files changed, 0 insertions, 443 deletions
diff --git a/scipy/basic/session1a.tex b/scipy/basic/session1a.tex index ded2a91..d0c5bf3 100644 --- a/scipy/basic/session1a.tex +++ b/scipy/basic/session1a.tex @@ -660,55 +660,3 @@ In []: plot?? \end{frame} \end{document} - -%% Questions for Quiz %% -%% ------------------ %% - -\begin{frame}[fragile] -\frametitle{\incqno } -Draw (roughly) the plot obtained by the following: -\begin{lstlisting} -In []: x = linspace(0, pi, 3) -In []: plot(x, sin(x)) -\end{lstlisting} -\end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } -Describe the plot produced by the following: -\begin{lstlisting} -In []: x = linspace(0, 2*pi, 50) -In []: plot(x, cos(x), 'go') -\end{lstlisting} -\end{frame} - -\begin{frame} -\frametitle{\incqno } -How will you plot the previous graph with line width set to 3? How will -you set the $x$ and $y$ labels of the plot? -\end{frame} - -\begin{frame} -\frametitle{\incqno } -How will you set the x and y axis limits so that the region of interest -is in the rectangle $(0, -1.5)$ (left bottom coordinate) and $(2\pi, -1.5)$ (right top coordinate)? -\end{frame} - -\begin{frame} -\frametitle{\incqno } -What ipython magic command do you use to obtain the lines of code you have already typed in the interpreter? What command do you use to save them? -\end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } -The following code snippet has an error/bug: -\begin{lstlisting} -In []: y = linspace(0, 2*pi, 50) -In []: plot(y, sin(y)) -In []: clf() -In []: plot(y, cos(y)) -In []: legend(['sin(y)', 'cos(y)']) -\end{lstlisting} -What is the error? How do you fix it? -\end{frame} diff --git a/scipy/basic/session1b.tex b/scipy/basic/session1b.tex index 87b2a8a..04bba5a 100644 --- a/scipy/basic/session1b.tex +++ b/scipy/basic/session1b.tex @@ -420,55 +420,3 @@ show() \end{document} - -%% Questions for Quiz %% -%% ------------------ %% - -\begin{frame}[fragile] -\frametitle{\incqno } -Draw (roughly) the plot obtained by the following: -\begin{lstlisting} -In []: x = linspace(0, pi, 3) -In []: plot(x, sin(x)) -\end{lstlisting} -\end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } -Describe the plot produced by the following: -\begin{lstlisting} -In []: x = linspace(0, 2*pi, 50) -In []: plot(x, cos(x), 'go') -\end{lstlisting} -\end{frame} - -\begin{frame} -\frametitle{\incqno } -How will you plot the previous graph with line width set to 3? How will -you set the $x$ and $y$ labels of the plot? -\end{frame} - -\begin{frame} -\frametitle{\incqno } -How will you set the x and y axis limits so that the region of interest -is in the rectangle $(0, -1.5)$ (left bottom coordinate) and $(2\pi, -1.5)$ (right top coordinate)? -\end{frame} - -\begin{frame} -\frametitle{\incqno } -What ipython magic command do you use to obtain the lines of code you have already typed in the interpreter? What command do you use to save them? -\end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } -The following code snippet has an error/bug: -\begin{lstlisting} -In []: y = linspace(0, 2*pi, 50) -In []: plot(y, sin(y)) -In []: clf() -In []: plot(y, cos(y)) -In []: legend(['sin(y)', 'cos(y)']) -\end{lstlisting} -What is the error? How do you fix it? -\end{frame} diff --git a/scipy/basic/session2a.tex b/scipy/basic/session2a.tex index 964df5a..d5e936f 100644 --- a/scipy/basic/session2a.tex +++ b/scipy/basic/session2a.tex @@ -552,57 +552,3 @@ In []: %timeit t*t \end{frame} \end{document} - -%% Questions for Quiz %% -%% ------------------ %% - -\begin{frame}[fragile] -\frametitle{\incqno } - \begin{lstlisting} - In []: a = [1, 2, 5, 9] - In []: a[0:-1] - \end{lstlisting} - What is the output? -\end{frame} - -\begin{frame} -\frametitle{\incqno } - How do you combine two lists \emph{a} and \emph{b} to produce one list? -\end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } - \begin{lstlisting} - In []: a = [1, 2, 5, 9] - \end{lstlisting} - How do you add the value 10 to the end of this list? -\end{frame} - -\begin{frame} -\frametitle{\incqno } -Write the code to read a file \texttt{data.txt} and print each line of it? -\end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } -What would be the result of the following code snippet: -\begin{lstlisting} -In []: x = linspace(0, 10, 50) -In []: y = linspace(50, 100, 100) -In []: plot(x, y) -\end{lstlisting} -\end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } -The following code snippet has an error/bug: -\begin{lstlisting} -In []: l = [0.1, 0.2, 0.3, 0.4] -In []: t = [0.69, 0.90, 1.19, 1.30] -In []: tsq = [] -In []: for time in t: - ....: tsq.append(time*time) - ....: plot(l, tsq) -\end{lstlisting} -What is the error? How do you fix it? -\end{frame} diff --git a/scipy/basic/session2b.tex b/scipy/basic/session2b.tex index dd97597..6180ea2 100644 --- a/scipy/basic/session2b.tex +++ b/scipy/basic/session2b.tex @@ -548,57 +548,3 @@ Out[]: 0.25979158313283879 \end{frame} \end{document} - -%% Questions for Quiz %% -%% ------------------ %% - -\begin{frame}[fragile] -\frametitle{\incqno } - \begin{lstlisting} - In []: a = [1, 2, 5, 9] - In []: a[0:-1] - \end{lstlisting} - What is the output? -\end{frame} - -\begin{frame} -\frametitle{\incqno } - How do you combine two lists \emph{a} and \emph{b} to produce one list? -\end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } - \begin{lstlisting} - In []: a = [1, 2, 5, 9] - \end{lstlisting} - How do you add the value 10 to the end of this list? -\end{frame} - -\begin{frame} -\frametitle{\incqno } -Write the code to read a file \texttt{data.txt} and print each line of it? -\end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } -What would be the result of the following code snippet: -\begin{lstlisting} -In []: x = linspace(0, 10, 50) -In []: y = linspace(50, 100, 100) -In []: plot(x, y) -\end{lstlisting} -\end{frame} - -\begin{frame}[fragile] -\frametitle{\incqno } -The following code snippet has an error/bug: -\begin{lstlisting} -In []: l = [0.1, 0.2, 0.3, 0.4] -In []: t = [0.69, 0.90, 1.19, 1.30] -In []: tsq = [] -In []: for time in t: - ....: tsq.append(time*time) - ....: plot(l, tsq) -\end{lstlisting} -What is the error? How do you fix it? -\end{frame} 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} diff --git a/scipy/basic/session4.tex b/scipy/basic/session4.tex index d56547a..4c65d24 100644 --- a/scipy/basic/session4.tex +++ b/scipy/basic/session4.tex @@ -507,129 +507,3 @@ Only scratched the surface here \dots \end{frame} \end{document} - -%% Questions for Quiz %% -%% ------------------ %% - -\begin{frame} -\frametitle{\incqno } -Given a 4x4 matrix \texttt{A} and a 4-vector \texttt{b}, what command do -you use to solve for the equation \\ -\texttt{Ax = b}? -\end{frame} - -\begin{frame} -\frametitle{\incqno } -What command will you use if you wish to integrate a system of ODEs? -\end{frame} - -\begin{frame} -\frametitle{\incqno } -How do you calculate the roots of the polynomial, $y = 1 + 6x + 8x^2 + -x^3$? -\end{frame} - -\begin{frame} -\frametitle{\incqno } -Two arrays \lstinline+a+ and \lstinline+b+ are numerically almost equal, what command -do you use to check if this is true? -\end{frame} - -%% \begin{frame}[fragile] -%% \frametitle{\incqno } -%% \begin{lstlisting} -%% In []: x = arange(0, 1, 0.25) -%% In []: print x -%% \end{lstlisting} -%% What will be printed? -%% \end{frame} - - -%% \begin{frame}[fragile] -%% \frametitle{\incqno } -%% \begin{lstlisting} -%% from scipy.integrate import quad -%% def f(x): -%% res = x*cos(x) -%% quad(f, 0, 1) -%% \end{lstlisting} -%% What changes will you make to the above code to make it work? -%% \end{frame} - -%% \begin{frame} -%% \frametitle{\incqno } -%% What two commands will you use to create and evaluate a spline given -%% some data? -%% \end{frame} - -%% \begin{frame}[fragile] -%% \frametitle{\incqno } -%% What would be the result? -%% \begin{lstlisting} -%% In []: x -%% array([[0, 1, 2], -%% [3, 4, 5], -%% [6, 7, 8]]) -%% In []: x[::-1,:] -%% \end{lstlisting} -%% Hint: -%% \begin{lstlisting} -%% In []: x = arange(9) -%% In []: x[::-1] -%% array([8, 7, 6, 5, 4, 3, 2, 1, 0]) -%% \end{lstlisting} -%% \end{frame} - -%% \begin{frame}[fragile] -%% \frametitle{\incqno } -%% What would be the result? -%% \begin{lstlisting} -%% In []: y = arange(3) -%% In []: x = linspace(0,3,3) -%% In []: x-y -%% \end{lstlisting} -%% \end{frame} - -%% \begin{frame}[fragile] -%% \frametitle{\incqno } -%% \begin{lstlisting} -%% In []: x -%% array([[ 0, 1, 2, 3], -%% [ 4, 5, 6, 7], -%% [ 8, 9, 10, 11], -%% [12, 13, 14, 15]]) -%% \end{lstlisting} -%% How will you get the following \lstinline+x+? -%% \begin{lstlisting} -%% array([[ 5, 7], -%% [ 9, 11]]) -%% \end{lstlisting} -%% \end{frame} - -%% \begin{frame}[fragile] -%% \frametitle{\incqno } -%% What would be the output? -%% \begin{lstlisting} -%% In []: y = arange(4) -%% In []: x = array(([1,2,3,2],[1,3,6,0])) -%% In []: x + y -%% \end{lstlisting} -%% \end{frame} - -%% \begin{frame}[fragile] -%% \frametitle{\incqno } -%% \begin{lstlisting} -%% In []: line = plot(x, sin(x)) -%% \end{lstlisting} -%% Use the \lstinline+set_linewidth+ method to set width of \lstinline+line+ to 2. -%% \end{frame} - -%% \begin{frame}[fragile] -%% \frametitle{\incqno } -%% What would be the output? -%% \begin{lstlisting} -%% In []: x = arange(9) -%% In []: y = arange(9.) -%% In []: x == y -%% \end{lstlisting} -%% \end{frame} |