Skip to main content
Version: Python

len

The len method returns the length of the given input. This is useful in query strings where a user needs to get the size of a Vector or a Java array.

Syntax

len(values)

Parameters

ParameterTypeDescription
valuesUnion[byte[], char[], double[], float[], int[], long[], short[], LongSizedDataStructure, T[]

An input array for which the length will be calculated.

Returns

A long-typed value representing the length of the input.

Example

The following example demonstrates the use of len within a query string.

from deephaven import empty_table

source = empty_table(10).update(["X = i"]).group_by()
result = source.update(["LenX = len(X)"])