[SciPy-User] Glitch in the map_coordinates doc
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
>> <firstname.lastname@example.org <mailto:email@example.com>> wrote:
>> Hello all,
>> In the map_coordinate reference document page
>> 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
>> 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
> 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.
More information about the SciPy-User