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)[]
    • Optional type: Null

    Returns Vector<dtypes.Null>

    Example

    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)[]
    • Optional type: Bool

    Returns Vector<dtypes.Bool>

  • Type Parameters

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

    Parameters

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

    Returns Vector<T>

  • Type Parameters

    • T extends Date_<Dates, T>

    Parameters

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

    Returns Vector<T>

  • Type Parameters

    • T extends Int_<Ints, T>

    Parameters

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

    Returns Vector<T>

  • Type Parameters

    • T extends Int64 | Uint64 = Int64

    Parameters

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

    Returns Vector<T>

  • Type Parameters

    • T extends Float<Floats, T> = Float64

    Parameters

    • values: readonly (undefined | null | number)[]
    • Optional type: 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 BigIntArray | TypedArray

    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[] | BigIntArray | TypedArray

    Parameters

    • data: T

    Returns Vector<ArrayDataType<T>>

Generated using TypeDoc