diff options
author | Jovina | 2011-09-13 16:30:42 +0530 |
---|---|---|
committer | Jovina | 2011-09-13 16:30:42 +0530 |
commit | 257dd79386cea651b45f67885e0bf3850681252c (patch) | |
tree | 7313ffea194674a2d630a2d87a035059952930f9 | |
parent | 483021b097addf9aad7cce7fb53a3bbc9f55ffec (diff) | |
download | sees-257dd79386cea651b45f67885e0bf3850681252c.tar.gz sees-257dd79386cea651b45f67885e0bf3850681252c.tar.bz2 sees-257dd79386cea651b45f67885e0bf3850681252c.zip |
Minor changes to 'advanced python'.
-rw-r--r-- | advanced_python/arrays.rst | 3 | ||||
-rw-r--r-- | advanced_python/modules.rst | 10 | ||||
-rw-r--r-- | advanced_python/plotting.rst | 6 | ||||
-rw-r--r-- | advanced_python/rst.rst | 12 |
4 files changed, 14 insertions, 17 deletions
diff --git a/advanced_python/arrays.rst b/advanced_python/arrays.rst index f4f020a..d5699ce 100644 --- a/advanced_python/arrays.rst +++ b/advanced_python/arrays.rst @@ -365,12 +365,11 @@ array. To access, the third column of C, we said, ``C[:, 2]``. Essentially, we are accessing all the rows in column three of C. Now, let us modify this to access only the first three rows, of column three of C. - We say, :: - C[0:3, 2] + C[0:3, 2] to get the elements of rows indexed from 0 to 3, 3 not included and column indexed 2. Note that, the index before the colon is included and the index diff --git a/advanced_python/modules.rst b/advanced_python/modules.rst index 8932778..833334d 100644 --- a/advanced_python/modules.rst +++ b/advanced_python/modules.rst @@ -91,8 +91,8 @@ Yes! it worked. So what did we do? We actually imported the required functions and keywords, using ``import``. By using the *, we are asking python to import everything from the ``scipy`` and ``pylab`` modules. This isn't a good practice, as - 1. it imports a lot of unnecessary things - 2. the two modules may have functions with the same name, which would +1. it imports a lot of unnecessary things +2. the two modules may have functions with the same name, which would cause a conflict. One of the ways out is to import only the stuff that we need, explicitly. @@ -174,8 +174,7 @@ Often we will have to reuse the code that we have previously written. We do that by writing functions. Functions can then be put into modules, and imported as and when required. -Let us first write a function that computes the gcd of two numbers and save -it in a script. +Let us first write a function that computes the gcd of two numbers and save it in a script. :: @@ -184,8 +183,7 @@ it in a script. a, b = b, a%b return a -Now, we shall write a test function in the script that tests the gcd -function, to see if it works. +Now, we shall write a test function in the script that tests the gcd function, to see if it works. :: diff --git a/advanced_python/plotting.rst b/advanced_python/plotting.rst index 34e0726..d019c75 100644 --- a/advanced_python/plotting.rst +++ b/advanced_python/plotting.rst @@ -87,11 +87,9 @@ Embellishing Plots Now that we know how to make simple plots, let us look at embellishing the plots. We shall look at how to modify the colour, thickness and line-style of a plot. We shall then learn how to add title to a plot and then look at -adding labels to x and y axes. We shall also look at adding annotations to -the plot and setting the limits on the axes. +adding labels to x and y axes. We shall also look at adding annotations to the plot and setting the limits on the axes. -Let us decorate the sine curve that we have already plotted. If you have -closed that window or your IPython terminal, redo the plot. +Let us decorate the sine curve that we have already plotted. If you have closed that window or your IPython terminal, redo the plot. :: diff --git a/advanced_python/rst.rst b/advanced_python/rst.rst index 577b94f..a43f5a3 100644 --- a/advanced_python/rst.rst +++ b/advanced_python/rst.rst @@ -27,14 +27,16 @@ Why ReST? Tools used ---------- - + You will need python-docutils to compile your ReST documents:: + + You will need python-docutils to compile your ReST documents +:: - sudo apt-get install python-docutils + sudo apt-get install python-docutils + To build websites, look at Sphinx, rest2web, etc. - + rst2html doesn't support math. We shall use Sphinx to see how math works:: + + rst2html doesn't support math. We shall use Sphinx to see how math works +:: - sudo apt-get install python-sphinx + sudo apt-get install python-sphinx Generating output ----------------- @@ -200,7 +202,7 @@ Tables... --------- Grid Tables -~~~~~~~~~~~ +----------- :: |