# HG changeset patch # User Santosh G. Vattam # Date 1271315884 -19800 # Node ID 806cca3b723180f7572f27b6edc9146cd3a311d8 # Parent f4e89590219706dbfbd3f856291a49826add73af Minor edits. diff -r f4e895902197 -r 806cca3b7231 arrays.txt --- a/arrays.txt Thu Apr 15 12:01:11 2010 +0530 +++ b/arrays.txt Thu Apr 15 12:48:04 2010 +0530 @@ -1,14 +1,14 @@ -Hello and welcome to the tutorial on Matrices. -All matrices operations are done using arrays. -We have already seen in previous session that how arrays are better suited for particular mathematical operations. In this session we are going to cover more details on Arrays(matrices), how to create/initialize them, how to manipulate and use them for solving given problem. +Hello friends and welcome to this tutorial on Matrices. +In python all matrix operations are done using arrays. +We have already seen in previous session that how arrays are better suited for certain mathematical operations. In this session we are going to cover more details on using Arrays as matrices, such as, how to create them, how to initialize them, how to manipulate and use them for solving given problem. -First thing first, we start with creating a normal array by: -a (equal to)= array([5, 8, 10, 13]) +First things first, let's start by creating a normal array, type: +a equal to array([5, 8, 10, 13]) -and we have a as array, check the value by +let's check the value of a by typing a -Here a is single dimension array, that is it has only one row. We can create multi-dimensional arrays by +Here a is single dimension array, that is it has only one row. Let's now look at creating multi-dimensional arrays by c = array([[11,12,13], [21,22,23], [31,32,33]]) @@ -17,12 +17,12 @@ a.shape c.shape -some other handy array initialization methods are also available to make life easier. -say we want to create an array of size 3x4 with all the values initialized to be 1, we can use +A few other handy array initialization methods are also available to make life easier. +say we want to create an array of size 3x4 with all the elements initialized to 1, we use b = ones((3, 4)) and b will be b -similarly, if we already have an array, and we want to create one more array with the same shape and initial values to be one, for that we will use +similarly, say we already have an array, and we want to create one more array with the same shape and initial values to be one, for that we will use d = ones_like(c) and d will be 3x3 array with all values 1 diff -r f4e895902197 -r 806cca3b7231 presentations/arrays.tex --- a/presentations/arrays.tex Thu Apr 15 12:01:11 2010 +0530 +++ b/presentations/arrays.tex Thu Apr 15 12:48:04 2010 +0530 @@ -85,7 +85,7 @@ \begin{frame} \frametitle{Matrix operations using arrays} - Understanding the structure of sslc.txt + Matrices using arrays: \begin{itemize} \item Creating and initializing arrays \item Manipulating arrays