Function vectorFromArray

  • Creates a Vector from a JavaScript array via a Builder. Use makeVector if you only want to create a vector from a typed array.

    Parameters

    • values: readonly (undefined | null)[]
    • Optionaltype: Null

    Returns Vector<dtypes.Null>

    const vf64 = vectorFromArray([1, 2, 3]);
    const vi8 = vectorFromArray([1, 2, 3], new Int8);
    const vdict = vectorFromArray(['foo', 'bar']);
    const vstruct = vectorFromArray([{a: 'foo', b: 42}, {a: 'bar', b: 12}]);
  • Parameters

    • values: readonly (undefined | null | boolean)[]
    • Optionaltype: Bool

    Returns Vector<dtypes.Bool>

  • Type Parameters

    • T extends Utf8 | Dictionary<Utf8, TKeys> = Dictionary<Utf8, Int32>

    Parameters

    • values: readonly (undefined | null | string)[]
    • Optionaltype: T

    Returns Vector<T>

  • Type Parameters

    • T extends TimestampMillisecond

    Parameters

    • values: readonly (undefined | null | Date)[]
    • Optionaltype: T

    Returns Vector<T>

  • Type Parameters

    • T extends Int_<Ints>

    Parameters

    • values: readonly (undefined | null | number)[]
    • type: T

    Returns Vector<T>

  • Type Parameters

    • T extends Int64 | Uint64 = Int64

    Parameters

    • values: readonly (undefined | null | bigint)[]
    • Optionaltype: T

    Returns Vector<T>

  • Type Parameters

    • T extends Float<Floats> = Float64

    Parameters

    • values: readonly (undefined | null | number)[]
    • Optionaltype: T

    Returns Vector<T>

  • Type Parameters

    Parameters

    • values: readonly unknown[]
    • type: T

    Returns Vector<T>

  • Type Parameters

    • T extends readonly unknown[]

    Parameters

    • values: T

    Returns Vector<JavaScriptArrayDataType<T>>

  • Creates a Vector from a typed array via makeVector.

    Type Parameters

    • T extends TypedArray | BigIntArray

    Parameters

    • data: T

    Returns Vector<TypedArrayDataType<T>>

  • Type Parameters

    Parameters

    Returns Vector<T>

  • Type Parameters

    Parameters

    Returns Vector<T>

  • Type Parameters

    Parameters

    • data: DataProps<T>

    Returns Vector<T>

  • Type Parameters

    • T extends readonly unknown[] | TypedArray | BigIntArray

    Parameters

    • data: T

    Returns Vector<ArrayDataType<T>>