[GRASS-SVN] r64829 - grass/branches/releasebranch_7_0/lib/python/script

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 10 07:21:23 PDT 2015


Author: annakrat
Date: 2015-03-10 07:21:22 -0700 (Tue, 10 Mar 2015)
New Revision: 64829

Modified:
   grass/branches/releasebranch_7_0/lib/python/script/array.py
Log:
Fix examples in script.array, merge from trunk r64820

Modified: grass/branches/releasebranch_7_0/lib/python/script/array.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/script/array.py	2015-03-10 14:19:18 UTC (rev 64828)
+++ grass/branches/releasebranch_7_0/lib/python/script/array.py	2015-03-10 14:21:22 UTC (rev 64829)
@@ -18,7 +18,7 @@
 >>> # Write some data
 ... for y in range(map2d_1.shape[0]):
 ...     for x in range(map2d_1.shape[1]):
-...         map2d_1[y][x] = y + x
+...         map2d_1[y,x] = y + x
 ...
 >>> # Lets have a look at the array
 ... print map2d_1
@@ -59,7 +59,7 @@
 ... for z in range(map3d_1.shape[0]):
 ...     for y in range(map3d_1.shape[1]):
 ...         for x in range(map3d_1.shape[2]):
-...             map3d_1[z][y][x] = z + y + x
+...             map3d_1[z,y,x] = z + y + x
 ...
 >>> # Lets have a look at the 3D array
 ... print map3d_1



More information about the grass-commit mailing list