Python SciPy – ndimage.map_coordinates() function
This function is used to map the given array to new coordinates by interpolation. The array of coordinates is used to find, for each point in the output, the corresponding coordinates in the input.
Syntax: scipy.ndimage.map_coordinates(input, coordinates, output=None, order=3,cval=0.0, prefilter=True)
- input: which is of array_like – The input array.
- coordinates: which is of array_like- The coordinates at which input is evaluated.
- output: which is an array – The array in which to place the output.
- order: which is of int, – it is optional,The order of the spline interpolation,
- cval: it is a scalar,- it is optional,The Value to fill past edges of input if mode is ‘constant’. Default is 0.0.
- prefilter: it is of boolean type, it is optional. it is used to determine if the input array is prefiltered with spline_filter before interpolation.
Returns: map_coordinates: ndarray
array([1.7, 5. ])
[2. 6.] [ True True] [2. 6.]
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course