Options
All
  • Public
  • Public/Protected
  • All
Menu

DataFrame extends Table with support for predicate filtering.

You can construct DataFrames like tables or convert a Table to a DataFrame with the constructor.

const df = new DataFrame(table);

Type parameters

  • T: {} = any

Hierarchy

Index

Constructors

constructor

Properties

Readonly TArray

TArray: IterableArrayLike<RowLike<T>>

Readonly TType

TType: Struct

Readonly TValue

TValue: RowLike<T>

Readonly [Symbol.isConcatSpreadable]

[Symbol.isConcatSpreadable]: boolean

Accessors

ArrayType

  • get ArrayType(): any

VectorName

  • get VectorName(): string

byteLength

  • get byteLength(): number

chunks

data

  • get data(): Data<T>

dictionary

  • get dictionary(): null | ChunkedDict<T>

indices

  • get indices(): null | ChunkedKeys<T>

length

  • get length(): number

nullCount

  • get nullCount(): number

numChildren

  • get numChildren(): number

numCols

  • get numCols(): number

schema

stride

  • get stride(): number

type

  • get type(): T

typeId

  • get typeId(): T["TType"]

Methods

[Symbol.iterator]

  • [Symbol.iterator](): IterableIterator<RowLike<T>>

assign

clone

concat

count

  • count(): number

countBy

  • countBy(name: string | Col<any>): CountByResult<any, Int_<Ints>>

filter

  • filter(predicate: Predicate): FilteredDataFrame<T>

get

  • get(index: number): RowLike<T>

getChildAt

  • getChildAt<R>(index: number): null | Column<R>

getColumn

  • getColumn<R>(name: R): Column<T[R]>

getColumnAt

  • getColumnAt<R>(index: number): null | Column<R>

getColumnIndex

  • getColumnIndex<R>(name: R): number

indexOf

  • indexOf(element: RowLike<T>, offset?: number): number

isValid

  • isValid(index: number): boolean

scan

  • scan(next: NextFunc, bind?: BindFunc): void

scanReverse

  • scanReverse(next: NextFunc, bind?: BindFunc): void

search

  • search(index: number): null | [number, number]
  • search<N>(index: number, then?: N): ReturnType<N>

select

  • select<K>(...columnNames: K[]): Table<{}>
  • Type parameters

    • K: string | number | symbol = any

    Parameters

    • Rest ...columnNames: K[]

    Returns Table<{}>

selectAt

  • selectAt<K>(...columnIndices: number[]): Table<{}>

serialize

  • serialize(encoding?: string, stream?: boolean): Uint8Array
  • Parameters

    • encoding: string = 'binary'
    • stream: boolean = true

    Returns Uint8Array

set

  • set(index: number, value: null | RowLike<T>): void

slice

  • slice(begin?: number, end?: number): Table<T>

toArray

  • toArray(): IterableArrayLike<RowLike<T>>

Static concat

  • concat<T>(...vectors: (Vector<T> | Vector<T>[])[]): Chunked<T>

Static empty

  • nocollapse

    Type parameters

    • T: {} = Record<string, never>

    Parameters

    Returns Table<T>

Static flatten

Static from

  • from(): Table<Record<string, never>>
  • from<T>(source: RecordBatchReader<T>): Table<T>
  • from<T>(source: ArrowJSONLike): Table<T>
  • from<T>(source: FromArg2): Table<T>
  • from<T>(source: FromArg1): Promise<Table<T>>
  • from<T>(source: FromArg3): Promise<Table<T>>
  • from<T>(source: FromArg4): Promise<Table<T>>
  • from<T>(source: FromArg5): Promise<Table<T>>
  • from<T>(source: PromiseLike<RecordBatchReader<T>>): Promise<Table<T>>
  • from<T, TNull>(options: VectorBuilderOptions<Struct<T>, TNull>): Table<T>
  • from<T, TNull>(options: VectorBuilderOptionsAsync<Struct<T>, TNull>): Promise<Table<T>>

Static fromAsync

  • fromAsync<T>(source: FromArgs): Promise<Table<T>>

Static fromStruct

Static new

  • new<T>(...columns: Columns<T>): Table<T>
  • new<T>(children: T): Table<{[ P in string | number | symbol]: T[P] extends Vector<any> ? any[any]["type"] : T[P] extends Uint8Array | Int32Array | Int8Array | Int16Array | Uint16Array | Uint32Array | Float32Array | Float64Array ? TypedArrayDataType<any[any]> : never }>
  • new<T>(children: ChildData<T>, fields?: keyof T[] | Field<T[keyof T]>[]): Table<T>
  • summary

    Create a new Table from a collection of Columns or Vectors, with an optional list of names or Fields.

    Table.new accepts an Object of Columns or Vectors, where the keys will be used as the field names for the Schema:

    const i32s = Int32Vector.from([1, 2, 3]);
    const f32s = Float32Vector.from([.1, .2, .3]);
    const table = Table.new({ i32: i32s, f32: f32s });
    assert(table.schema.fields[0].name === 'i32');
    

    It also accepts a a list of Vectors with an optional list of names or Fields for the resulting Schema. If the list is omitted or a name is missing, the numeric index of each Vector will be used as the name:

    const i32s = Int32Vector.from([1, 2, 3]);
    const f32s = Float32Vector.from([.1, .2, .3]);
    const table = Table.new([i32s, f32s], ['i32']);
    assert(table.schema.fields[0].name === 'i32');
    assert(table.schema.fields[1].name === '1');
    

    If the supplied arguments are Columns, Table.new will infer the Schema from the Columns:

    const i32s = Column.new('i32', Int32Vector.from([1, 2, 3]));
    const f32s = Column.new('f32', Float32Vector.from([.1, .2, .3]));
    const table = Table.new(i32s, f32s);
    assert(table.schema.fields[0].name === 'i32');
    assert(table.schema.fields[1].name === 'f32');
    

    If the supplied Vector or Column lengths are unequal, Table.new will extend the lengths of the shorter Columns, allocating additional bytes to represent the additional null slots. The memory required to allocate these additional bitmaps can be computed as:

    let additionalBytes = 0;
    for (let vec in shorter_vectors) {
        additionalBytes += (((longestLength - vec.length) + 63) & ~63) >> 3;
    }
    

    For example, an additional null bitmap for one million null values would require 125,000 bytes (((1e6 + 63) & ~63) >> 3), or approx. 0.11MiB

    Type parameters

    • T: {} = any

    Parameters

    • Rest ...columns: Columns<T>

    Returns Table<T>

  • Type parameters

    • T: VectorMap = any

    Parameters

    • children: T

    Returns Table<{[ P in string | number | symbol]: T[P] extends Vector<any> ? any[any]["type"] : T[P] extends Uint8Array | Int32Array | Int8Array | Int16Array | Uint16Array | Uint32Array | Float32Array | Float64Array ? TypedArrayDataType<any[any]> : never }>

  • Type parameters

    • T: {} = any

    Parameters

    • children: ChildData<T>
    • Optional fields: keyof T[] | Field<T[keyof T]>[]

    Returns Table<T>

Generated using TypeDoc