[SciPy-User] Glitch in the map_coordinates doc

Warren Weckesser warren.weckesser at enthought.com
Thu Aug 19 12:21:11 EDT 2010


Ralf Gommers wrote:
>
>
> On Wed, Aug 18, 2010 at 10:30 PM, Jean-Luc Menut 
> <jeanluc.menut at free.fr <mailto:jeanluc.menut at free.fr>> wrote:
>
>     Hello all,
>
>     In the map_coordinate reference document page
>     (http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.interpolation.map_coordinates.html),
>     there is this example :
>
>      >>> import scipy.ndimage
>      >>> a = np.arange(12.).reshape((4, 3))
>      >>> a
>     array([[  0.,   1.,   2.],
>            [  3.,   4.,   5.],
>            [  6.,   7.,   8.],
>            [  9.,  10.,  11.]])
>      >>> sp.ndimage.map_coordinates(a, [[0.5, 2], [0.5, 1]], order=1)
>     [ 2.  7.]
>
>
>     According to the last line, import scipy.ndimage should be import
>     scipy
>     as sp.
>
> In all examples the lines "import scipy as sp" and "import numpy as 
> np" are assumed to have been executed, no need to repeat that in every 
> docstring. Subpackages like ndimage do need to be imported seperately. 
> So the example is fine. See 
> http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines.
>

The first line of the example, "import scipy.ndimage", can be removed.

Warren

> Cheers,
> Ralf
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>   




More information about the SciPy-User mailing list