Get From Vector

Extracts single number from vector column. The number is specified by index parameter. The output column will have double type.

This operation also returns a Transformer that can be later applied to another DataFrame with Transform operation.

Since: Seahorse 1.2.0

Input

Port Type Qualifier Description
0 DataFrame The DataFrame with the vector column to get number from.

Output

Port Type Qualifier Description
0 DataFrame The output DataFrame.
1 Transformer A Transformer that allows to apply the operation to other DataFrames using a Transform.

Parameters

Name Type Description
index Numeric Index of the number to get from vector.
operate on InputOutputColumnSelector Input and output columns for the operation.

Example

Parameters

Name Value
index 1.0
operate on one column
input column "features"
output append new column
output column "second_feature"

Input

features
(3,[0,1],[-2.0,2.3])
[0.01,0.2,3.0]
null
(3,[1,2],[0.91,3.2])
(3,[0,2],[5.7,2.7])
[0.0,0.0,0.0]

Output

features second_feature
(3,[0,1],[-2.0,2.3]) 2.3
[0.01,0.2,3.0] 0.2
null null
(3,[1,2],[0.91,3.2]) 0.91
(3,[0,2],[5.7,2.7]) 0.0
[0.0,0.0,0.0] 0.0