diff options
author | Amit Sethi | 2010-11-08 01:56:03 +0530 |
---|---|---|
committer | Amit Sethi | 2010-11-08 01:56:03 +0530 |
commit | bf83e16caf164cdbcb3ddd72f44833109b989b97 (patch) | |
tree | d2d14c96af50041aa9cc29d8c3595aa8bcb16d3e /getting-started-with-arrays/slides.org | |
parent | e09d107f6a3c7ddd290e4390158f682c1ca2b0b4 (diff) | |
parent | 1535316de3744cb31b7f1eaa5006f30a15d0f31c (diff) | |
download | st-scripts-bf83e16caf164cdbcb3ddd72f44833109b989b97.tar.gz st-scripts-bf83e16caf164cdbcb3ddd72f44833109b989b97.tar.bz2 st-scripts-bf83e16caf164cdbcb3ddd72f44833109b989b97.zip |
Merging changes
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']) |