author | Puneeth Chaganti <punchagan@fossee.in> |
Fri, 05 Nov 2010 21:19:11 +0530 | |
changeset 380 | c17aa604468a |
parent 348 | 3f70aeb1e115 |
permissions | -rw-r--r-- |
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
1 |
% Created 2010-11-02 Tue 17:47 |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
2 |
\documentclass[presentation]{beamer} |
217
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
3 |
\usepackage[latin1]{inputenc} |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
4 |
\usepackage[T1]{fontenc} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
5 |
\usepackage{fixltx2e} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
6 |
\usepackage{graphicx} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
7 |
\usepackage{longtable} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
8 |
\usepackage{float} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
9 |
\usepackage{wrapfig} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
10 |
\usepackage{soul} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
11 |
\usepackage{textcomp} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
12 |
\usepackage{marvosym} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
13 |
\usepackage{wasysym} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
14 |
\usepackage{latexsym} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
15 |
\usepackage{amssymb} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
16 |
\usepackage{hyperref} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
17 |
\tolerance=1000 |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
18 |
\usepackage[english]{babel} \usepackage{ae,aecompl} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
19 |
\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
20 |
\usepackage{listings} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
21 |
\lstset{language=Python, basicstyle=\ttfamily\bfseries, |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
22 |
commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen}, |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
23 |
showstringspaces=false, keywordstyle=\color{blue}\bfseries} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
24 |
\providecommand{\alert}[1]{\textbf{#1}} |
217
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
25 |
|
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
26 |
\title{Accessing parts of arrays} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
27 |
\author{FOSSEE} |
217
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
28 |
\date{} |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
29 |
|
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
30 |
\usetheme{Antibes}\usecolortheme{lily}\useoutertheme{infolines}\setbeamercovered{transparent} |
217
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
31 |
\begin{document} |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
32 |
|
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
33 |
\maketitle |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
34 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
35 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
36 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
37 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
38 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
39 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
40 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
41 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
42 |
|
217
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
43 |
\begin{frame} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
44 |
\frametitle{Outline} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
45 |
\label{sec-1} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
46 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
47 |
\begin{itemize} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
48 |
\item Manipulating one and multi dimensional arrays |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
49 |
\item Access and change individual elements |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
50 |
\item Access and change rows and columns |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
51 |
\item Slicing and striding on arrays to access chunks |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
52 |
\item Read images into arrays and manipulations |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
53 |
\end{itemize} |
217
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
54 |
\end{frame} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
55 |
\begin{frame}[fragile] |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
56 |
\frametitle{Sample Arrays} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
57 |
\label{sec-2} |
217
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
58 |
|
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
59 |
\lstset{language=Python} |
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
60 |
\begin{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
61 |
In []: A = array([12, 23, 34, 45, 56]) |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
62 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
63 |
In []: C = array([[11, 12, 13, 14, 15], |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
64 |
[21, 22, 23, 24, 25], |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
65 |
[31, 32, 33, 34, 35], |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
66 |
[41, 42, 43, 44, 45], |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
67 |
[51, 52, 53, 54, 55]]) |
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
68 |
\end{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
69 |
\end{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
70 |
\begin{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
71 |
\frametitle{Question 1} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
72 |
\label{sec-3} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
73 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
74 |
Change the last column of \texttt{C} to zeroes. |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
75 |
\end{frame} |
217
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
76 |
\begin{frame}[fragile] |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
77 |
\frametitle{Solution 1} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
78 |
\label{sec-4} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
79 |
|
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
80 |
\lstset{language=Python} |
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
81 |
\begin{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
82 |
In []: C[:, -1] = 0 |
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
83 |
\end{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
84 |
\end{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
85 |
\begin{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
86 |
\frametitle{Question 2} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
87 |
\label{sec-5} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
88 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
89 |
Change \texttt{A} to \texttt{[11, 12, 13, 14, 15]}. |
217
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
90 |
\end{frame} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
91 |
\begin{frame}[fragile] |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
92 |
\frametitle{Solution 2} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
93 |
\label{sec-6} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
94 |
|
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
95 |
\lstset{language=Python} |
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
96 |
\begin{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
97 |
In []: A[:] = [11, 12, 13, 14, 15] |
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
98 |
\end{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
99 |
\end{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
100 |
\begin{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
101 |
\frametitle{squares.png} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
102 |
\label{sec-7} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
103 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
104 |
\begin{center} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
105 |
\includegraphics[scale=0.6]{squares} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
106 |
\end{center} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
107 |
\end{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
108 |
\begin{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
109 |
\frametitle{Question 3} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
110 |
\label{sec-8} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
111 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
112 |
\begin{itemize} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
113 |
\item obtain \texttt{[22, 23]} from \texttt{C}. |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
114 |
\item obtain \texttt{[11, 21, 31, 41]} from \texttt{C}. |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
115 |
\item obtain \texttt{[21, 31, 41, 0]}. |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
116 |
\end{itemize} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
117 |
\end{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
118 |
\begin{frame}[fragile] |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
119 |
\frametitle{Solution 3} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
120 |
\label{sec-9} |
217
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
121 |
|
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
122 |
\lstset{language=Python} |
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
123 |
\begin{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
124 |
In []: C[1, 1:3] |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
125 |
In []: C[0:4, 0] |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
126 |
In []: C[1:5, 0] |
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
127 |
\end{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
128 |
\end{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
129 |
\begin{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
130 |
\frametitle{Question 4} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
131 |
\label{sec-10} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
132 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
133 |
Obtain \texttt{[[23, 24], [33, -34]]} from \texttt{C} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
134 |
\end{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
135 |
\begin{frame}[fragile] |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
136 |
\frametitle{Solution 4} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
137 |
\label{sec-11} |
217
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
138 |
|
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
139 |
\lstset{language=Python} |
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
140 |
\begin{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
141 |
In []: C[1:3, 2:4] |
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
142 |
\end{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
143 |
\end{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
144 |
\begin{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
145 |
\frametitle{Question 5} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
146 |
\label{sec-12} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
147 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
148 |
Obtain the square in the center of the image |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
149 |
\end{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
150 |
\begin{frame}[fragile] |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
151 |
\frametitle{Solution 5} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
152 |
\label{sec-13} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
153 |
|
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
154 |
\lstset{language=Python} |
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
155 |
\begin{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
156 |
In []: imshow(I[75:225, 75:225]) |
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
157 |
\end{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
158 |
\end{frame} |
217
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
159 |
\begin{frame}[fragile] |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
160 |
\frametitle{Question 6} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
161 |
\label{sec-14} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
162 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
163 |
Obtain the following |
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
164 |
\lstset{language=Python} |
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
165 |
\begin{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
166 |
[[12, 0], [42, 0]] |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
167 |
[[12, 13, 14], [0, 0, 0]] |
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
168 |
\end{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
169 |
\end{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
170 |
\begin{frame}[fragile] |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
171 |
\frametitle{Solution 6} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
172 |
\label{sec-15} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
173 |
|
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
174 |
\lstset{language=Python} |
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
175 |
\begin{lstlisting} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
176 |
In []: C[::3, 1::3] |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
177 |
In []: C[::4, 1:4] |
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
178 |
\end{lstlisting} |
217
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
179 |
\end{frame} |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
180 |
\begin{frame} |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
181 |
\frametitle{Summary} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
182 |
\label{sec-16} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
183 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
184 |
You should now be able to -- |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
185 |
\begin{itemize} |
380
c17aa604468a
Changes to accessing parts of arrays during recording.
Puneeth Chaganti <punchagan@fossee.in>
parents:
348
diff
changeset
|
186 |
\item Manipulate single \& multi dimensional arrays |
270
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
187 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
188 |
\begin{itemize} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
189 |
\item Access and change individual elements |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
190 |
\item Access and change rows and columns |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
191 |
\item Slice and stride on arrays |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
192 |
\end{itemize} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
193 |
|
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
194 |
\item Read images into arrays and manipulate them. |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
195 |
\end{itemize} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
196 |
\end{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
197 |
\begin{frame} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
198 |
\frametitle{Thank you!} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
199 |
\label{sec-17} |
49c9bb72e08a
Slides for accessing parts of arrays LO.
Puneeth Chaganti <punchagan@fossee.in>
parents:
217
diff
changeset
|
200 |
|
217
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
201 |
\begin{block}{} |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
202 |
\begin{center} |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
203 |
This spoken tutorial has been produced by the |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
204 |
\textcolor{blue}{FOSSEE} team, which is funded by the |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
205 |
\end{center} |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
206 |
\begin{center} |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
207 |
\textcolor{blue}{National Mission on Education through \\ |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
208 |
Information \& Communication Technology \\ |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
209 |
MHRD, Govt. of India}. |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
210 |
\end{center} |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
211 |
\end{block} |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
212 |
\end{frame} |
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
213 |
|
b595f90016c5
Changed structure of my scripts.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff
changeset
|
214 |
\end{document} |