import numpy as np
import dascore as dc
patch = dc.get_example_patch()
# Take the absolute value of the patch.
abs_patch = patch.apply_ufunc(np.abs)
# Multiply the patch by 10.
scaled_patch = patch.apply_ufunc(np.multiply, 10)apply_ufunc
apply_ufunc(
self ,
ufunc ,
*args ,
**kwargs ,
)-> ‘Patch’
Apply a ufunc with the patch as its first operand.
Parameters
| Parameter | Description |
|---|---|
| ufunc | The ufunc to apply. |
| *args | The remaining operands, which can contain patches. |
| **kwargs |
Keyword arguments which configure the operation, such as dimfor a reduction or accumulation. |