diff options
author | Puneeth Chaganti | 2010-09-16 12:10:16 +0530 |
---|---|---|
committer | Puneeth Chaganti | 2010-09-16 12:10:16 +0530 |
commit | a0cc912f3a0a0d64504fd209691e35285e4812a9 (patch) | |
tree | b37ff232d1c5a399c746726f5ff917cf18d5cbf7 /module-assessment-arrays-matrices.rst | |
parent | 434daa765bd8294f99c9439e65afa78f5d50f3b9 (diff) | |
download | st-scripts-a0cc912f3a0a0d64504fd209691e35285e4812a9.tar.gz st-scripts-a0cc912f3a0a0d64504fd209691e35285e4812a9.tar.bz2 st-scripts-a0cc912f3a0a0d64504fd209691e35285e4812a9.zip |
Added rst files for scripts.
Diffstat (limited to 'module-assessment-arrays-matrices.rst')
-rw-r--r-- | module-assessment-arrays-matrices.rst | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/module-assessment-arrays-matrices.rst b/module-assessment-arrays-matrices.rst new file mode 100644 index 0000000..dbe609d --- /dev/null +++ b/module-assessment-arrays-matrices.rst @@ -0,0 +1,88 @@ +======== + Script +======== + +Welcome. + +This spoken tutorial is a self-assessment tutorial and you will be +able to assess yourself on the concepts learnt in the Module on Arrays +and Matrices. + + +As with all other assessments we will first start with a few short +questions that will not take you more that 15 to 20 seconds to +answer. Then we shall move on to a bigger problem, that you are +expected to solve in less than 10 mins. + + + * Given a list of marks:: + + marks = [10, 20, 30, 50, 55, 75, 83] + + How will you convert it to an array? + + * What is the shape of the following array?:: + + x = array([[1,2,3,4], + [3,4,2,5]]) + + * What is the resulting array:: + + a = array([[1, 2], + [3, 4]]) + + a[1,0] = 0 + + * What is the resulting array?:: + + x = array(([1,2,3,4], + [2,3,4,5])) + + x[-2][-3] = 4 + + + * How do we change the array ``x = array([[1,2,3,4]])`` to + ``array([[1,2,0,4]])``? + + * How do we get the slice:: + + array([[2,3], + [4,2]]) + + out of the array:: + + x = array([[1,2,3,4], + [3,4,2,5]]) + + + * What is the output of x[::3,::3], when x is:: + + x = array([[9,18,27], + [30,60,90], + [14,7,1]]) + + * How do you get the transpose of this array?:: + + a = array([[1, 2], + [3, 4]]) + + * What is the output of the following?:: + + a = array([[1, 2], + [3, 4]]) + + b = array([[1, 1], + [2, 2]]) + + a*b + + +{{{ show slides with solutions to these problems }}} + +Now, let us move on to a larger problem. From the image +`tagore-einstein.png`` + + + extract the face of Einstein alone. + + extract the face of Tagore alone. + + get a smaller copy of the image, that is a fourth it's size. + |