[SciPy-User] Glitch in the map_coordinates doc

Warren Weckesser warren.weckesser@enthought....
Thu Aug 19 11:33:19 CDT 2010


Warren Weckesser wrote:
> Ralf Gommers wrote:
>   
>> On Wed, Aug 18, 2010 at 10:30 PM, Jean-Luc Menut 
>> <jeanluc.menut@free.fr <mailto:jeanluc.menut@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.
>
>   

No, that is not correct.  It needs to be there, so Ralf was correct.


Warren




More information about the SciPy-User mailing list