from dascore.utils.array import apply_ufunc
import numpy as np
import dascore as dc
= dc.get_example_patch()
patch
# Call abs on a patch.
= apply_ufunc(np.abs, patch)
new1
# Add two patches
= apply_ufunc(np.add, patch, patch)
new2
# multiply the patch by 10
= apply_ufunc(np.multiply, patch, 10) new3
apply_ufunc
apply_ufunc(
ufunc ,
*args ,
**kwargs ,
)
Apply a ufunc to one or more patches.
Parameters
Parameter | Description |
---|---|
ufunc | The ufunc to use. |
*args | Additional positional arguments, can contain patches. |
**kwargs | Keyword arguments, can contain patches. |
Examples
Note