diff options
author | Anoop Jacob Thomas | 2010-11-07 15:43:46 +0530 |
---|---|---|
committer | Anoop Jacob Thomas | 2010-11-07 15:43:46 +0530 |
commit | 07bb56e3cca0dcd6fa3fe9060f0459556869c756 (patch) | |
tree | 2ada4aacf5d826e4067912d24675896729d2d2ad /getting-started-with-arrays/slides.org | |
parent | 218d55676a3f2f4988088a6b3f976d95d8ca8a6b (diff) | |
download | st-scripts-07bb56e3cca0dcd6fa3fe9060f0459556869c756.tar.gz st-scripts-07bb56e3cca0dcd6fa3fe9060f0459556869c756.tar.bz2 st-scripts-07bb56e3cca0dcd6fa3fe9060f0459556869c756.zip |
Made changes to script, getting started with arrays, as suggested in internal review.
Diffstat (limited to 'getting-started-with-arrays/slides.org')
-rw-r--r-- | getting-started-with-arrays/slides.org | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/getting-started-with-arrays/slides.org b/getting-started-with-arrays/slides.org index ba97f3c..a5b315f 100644 --- a/getting-started-with-arrays/slides.org +++ b/getting-started-with-arrays/slides.org @@ -44,9 +44,12 @@ * Creating Arrays - Creating a 1-dimensional array : In []: a1 = array([1, 2, 3, 4]) + ~[1, 2, 3, 4]~ is a list. +* Creating two-dimensional array - Creating a 2-dimensional array : In []: a2 = array([[1,2,3,4],[5,6,7,8]]) - - Easier method of creating array with consecutive elements. + here we convert a list of lists to an array making a 2-d array. + - Using ~arange()~ function : In []: ar = arange(1,9) * ~reshape()~ method - To reshape an array @@ -67,11 +70,11 @@ * ~.shape~ of array - ~.shape~ To find the shape of the array - : In []: a1.shape + : In []: a2.shape - ~.shape~ returns a tuple of shape * Exercise 2 - Find out the shape of the other arrays(a2, a3, ar) that we have created. + Find out the shape of the other arrays(a1, a3, ar) that we have created. * Homogeneous data - All elements in array should be of same type : In []: a4 = array([1,2,3,'a string']) |