Get Element

This function block is designed to extract an element from a batch (list or array) based on a specified index. It allows users to easily access individual data points from a collection.

📥 Inputs

Batch A collection (list or array) from which you want to retrieve an element.

Index The position (0-based index) of the desired element within the batch.

📤 Outputs

Generic This output provides the specific element retrieved from the input batch based on the provided index.

🎨 Features

Element Retrieval Users can quickly access specific elements from a batch using a designated index.

Versatile Input Types The block accepts various input types, allowing for flexibility in data handling.

📝 Usage Instructions

  1. Connect a Batch: Link a collection, such as a list or array, to the Batch input.

  2. Set an Index: Provide the index of the element you want to extract from the batch at the Index input.

  3. Retrieve Element: Upon evaluation, the block will output the element located at the specified index.

📊 Evaluation

When executed, this block outputs the element obtained from the input batch at the specified index.

🛠️ Troubleshooting

Index Out of Range

If you encounter an error regarding the index being out of range, ensure that the provided index is within the bounds of the batch (0 to length of batch - 1).

You can use Get Batch Size block to know the size of the provided collection.

Invalid Batch Type

If the input batch is not a valid type (for example, not a list or array), ensure that the data being fed into the block is in the correct format. You may want to use Data Type Converter to adjust the data type before this block.

Last updated