array_shift_left
This page explains how to use the array_shift_left function in APL.
The array_shift_left
function in APL rotates the elements of an array to the left by a specified number of positions. If the shift exceeds the array length, it wraps around and continues from the beginning. This function is useful when you need to realign or reorder elements for pattern analysis, comparisons, or other array transformations.
For example, you can use array_shift_left
to:
- Align time-series data for comparative analysis.
- Rotate log entries for cyclic pattern detection.
- Reorganize multi-dimensional datasets in your queries.
For users of other query languages
If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.
Usage
Syntax
Parameters
Parameter | Type | Description |
---|---|---|
array | Array | The array to shift. |
shift_amount | Integer | The number of positions to shift elements to the left. |
Returns
An array with elements shifted to the left by the specified shift_amount
. The function wraps the excess elements to the start of the array.
Use case example
Reorganize span events to analyze dependencies in a different sequence.
Query
Output
This query shifts span events for frontend
services to analyze the adjusted sequence.
List of related functions
- array_rotate_right: Rotates array elements to the right by a specified number of positions.
- array_rotate_left: Rotates elements of an array to the left.
- array_shift_right: Shifts array elements to the right.
Was this page helpful?