All functions share some common properties. Notably, all functions allow the
specification of an output array with the output argument. With this
argument you can specify an array that will be changed in-place with the
result with the operation. In this case the result is not returned. Usually,
using the output argument is more efficient, since an existing array
is used to store the result.
The type of arrays returned is dependent on the type of operation, but it is in most cases equal to the type of the input. If, however, the output argument is used, the type of the result is equal to the type of the specified output argument. If no output argument is given, it is still possible to specify what the result of the output should be. This is done by simply assigning the desired numarray type object to the output argument. For example:
In previous versions of numarray.nd_image, some functions accepted the output_type argument to achieve the same effect. This argument is still supported, but its use will generate an deprecation warning. In a future version all instances of this argument will be removed. The preferred way to specify an output type, is by using the output argument, either by specifying an output array of the desired type, or by specifying the type of the output that is to be returned.