np_diff
Calculate the n-th discrete difference of an array along a specified axis, useful for detecting changes or gradients in sequential data.
Instructions
Calculate the n-th discrete difference along the given axis.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| array | Yes | The input array. | |
| n | No | The number of times values are differenced (default: 1). | |
| axis | No | The axis along which to difference (default: 0). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |