Aller au contenu

DECIMATE_VECTOR

Ce contenu n’est pas encore disponible dans votre langue.

The DECIMATE_VECTOR node returns the input vector by reducing the number of points by given factor Inputs ------ default : Vector The input vector Params: factor : int Decimate factor which determines how many elements will be skipped between each selected element in the output vector Returns: out : Vector Decimated vector
Python Code
from flojoy import flojoy, Vector

@flojoy
def DECIMATE_VECTOR(
default: Vector,
factor: int = 1,
) -> Vector:
"""The DECIMATE_VECTOR node returns the input vector by reducing the
number of points by given factor

Inputs
------
default : Vector
The input vector

Parameters
----------
factor : int
Decimate factor which determines how many elements will be skipped
between each selected element in the output vector

Returns
-------
Vector
Decimated vector
"""

return Vector(v=default.v[::factor])


Find this Flojoy Block on GitHub

Example

In this example, we generate a vector type data using LINSPACE node.
Using DECIMATE_VECTOR node, we generate a new decimated vector and plot it in SCATTER node.