Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Table

A low-level wrapper for libcudf Table objects

Hierarchy

  • Table

Index

Properties

Readonly numColumns

numColumns: number

Number of columns in the table.

Readonly numRows

numRows: number

Number of rows in each column of the table.

Methods

applyBooleanMask

  • applyBooleanMask(selection: Column<Bool8>, memoryResource?: MemoryResource): Table
  • Return sub-selection from a Table.

    Parameters

    • selection: Column<Bool8>

      A Column of booleans. Rows at true indices are returned, false are omitted.

    • Optional memoryResource: MemoryResource

      An optional MemoryResource used to allocate the result's device memory.

    Returns Table

dispose

  • dispose(): void

distinct

  • distinct(keys: number[], nullsEqual: boolean, memoryResource?: MemoryResource): Table
  • summary

    Create a new table with duplicate rows removed.

    Parameters

    • keys: number[]

      List of column indices on which to operate.

    • nullsEqual: boolean

      Determines whether nulls are handled as equal values.

    • Optional memoryResource: MemoryResource

      An optional MemoryResource used to allocate the result's device memory.

    Returns Table

dropNans

  • dropNans(keys: number[], threshold: number): Table

dropNulls

  • dropNulls(keys: number[], threshold: number): Table

explode

  • explode(index: number, memoryResource?: MemoryResource): Table
  • summary

    Explodes a list column's elements.

    Any list is exploded, which means the elements of the list in each row are expanded into new rows in the output. The corresponding rows for other columns in the input are duplicated.

    Example:

    [[5,10,15], 100],
    [[20,25], 200],
    [[30], 300],
    returns
    [5, 100],
    [10, 100],
    [15, 100],
    [20, 200],
    [25, 200],
    [30, 300],

    Nulls and empty lists propagate in different ways depending on what is null or empty.

    [[5,null,15], 100],
    [null, 200],
    [[], 300],
    returns
    [5, 100],
    [null, 100],
    [15, 100],
    note

    null lists are not included in the resulting table, but nulls inside lists and empty lists will be represented with a null entry for that column in that row.

    Parameters

    • index: number

      Column index to explode inside the table.

    • Optional memoryResource: MemoryResource

      An optional MemoryResource used to allocate the result's device memory.

    Returns Table

explodeOuter

  • explodeOuter(index: number, memoryResource?: MemoryResource): Table
  • summary

    Explodes a list column's elements retaining any null entries or empty lists inside.

    Any list is exploded, which means the elements of the list in each row are expanded into new rows in the output. The corresponding rows for other columns in the input are duplicated.

    Example:

    [[5,10,15], 100],
    [[20,25], 200],
    [[30], 300],
    returns
    [5, 100],
    [10, 100],
    [15, 100],
    [20, 200],
    [25, 200],
    [30, 300],

    Nulls and empty lists propagate as null entries in the result.

    [[5,null,15], 100],
    [null, 200],
    [[], 300],
    returns
    [5, 100],
    [null, 100],
    [15, 100],
    [null, 200],
    [null, 300],

    Parameters

    • index: number

      Column index to explode inside the table.

    • Optional memoryResource: MemoryResource

      An optional MemoryResource used to allocate the result's device memory.

    Returns Table

explodeOuterPosition

  • explodeOuterPosition(index: number, memoryResource?: MemoryResource): Table
  • summary

    Explodes a list column's elements retaining any null entries or empty lists and includes a position column.

    Any list is exploded, which means the elements of the list in each row are expanded into new rows in the output. The corresponding rows for other columns in the input are duplicated. A position column is added that has the index inside the original list for each row.

    Example:

    [[5,10,15], 100],
    [[20,25], 200],
    [[30], 300],
    returns
    [0, 5, 100],
    [1, 10, 100],
    [2, 15, 100],
    [0, 20, 200],
    [1, 25, 200],
    [0, 30, 300],

    Nulls and empty lists propagate as null entries in the result.

    [[5,null,15], 100],
    [null, 200],
    [[], 300],
    returns
    [0, 5, 100],
    [1, null, 100],
    [2, 15, 100],
    [0, null, 200],
    [0, null, 300],

    Parameters

    • index: number

      Column index to explode inside the table.

    • Optional memoryResource: MemoryResource

      An optional MemoryResource used to allocate the result's device memory.

    Returns Table

explodePosition

  • explodePosition(index: number, memoryResource?: MemoryResource): Table
  • summary

    Explodes a list column's elements and includes a position column.

    Any list is exploded, which means the elements of the list in each row are expanded into new rows in the output. The corresponding rows for other columns in the input are duplicated. A position column is added that has the index inside the original list for each row.

    Example:

    [[5,10,15], 100],
    [[20,25], 200],
    [[30], 300],
    returns
    [0, 5, 100],
    [1, 10, 100],
    [2, 15, 100],
    [0, 20, 200],
    [1, 25, 200],
    [0, 30, 300],

    Nulls and empty lists propagate in different ways depending on what is null or empty.

    [[5,null,15], 100],
    [null, 200],
    [[], 300],
    returns
    [0, 5, 100],
    [1, null, 100],
    [2, 15, 100],
    note

    null lists are not included in the resulting table, but nulls inside lists and empty lists will be represented with a null entry for that column in that row.

    Parameters

    • index: number

      Column index to explode inside the table.

    • Optional memoryResource: MemoryResource

      An optional MemoryResource used to allocate the result's device memory.

    Returns Table

gather

  • gather(selection: Column<IndexType>, nullify_out_of_bounds: boolean, memoryResource?: MemoryResource): Table
  • summary

    Return sub-selection from a Table.

    description

    Gathers the rows of the source columns according to selection, such that row "i" in the resulting Table's columns will contain row selection[i] from the source columns. The number of rows in the result table will be equal to the number of elements in selection. A negative value i in the selection is interpreted as i+n, where n is the number of rows in the source table.

    For dictionary columns, the keys column component is copied and not trimmed if the gather results in abandoned key elements.

    Parameters

    • selection: Column<IndexType>

      A Series of 8/16/32-bit signed or unsigned integer indices to gather.

    • nullify_out_of_bounds: boolean

      If true, coerce rows that corresponds to out-of-bounds indices in the selection to null. If false, skips all bounds checking for selection values. Pass false if you are certain that the selection contains only valid indices for better performance. If false and there are out-of-bounds indices in the selection, the behavior is undefined. Defaults to false.

    • Optional memoryResource: MemoryResource

      An optional MemoryResource used to allocate the result's device memory.

    Returns Table

getColumnByIndex

  • getColumnByIndex<T>(index: number): Column<T>
  • Get the Column at a specified index

    reurns

    The Column located at index

    Type parameters

    Parameters

    • index: number

      The index position of the column to return

    Returns Column<T>

interleaveColumns

  • interleaveColumns(memoryResource?: MemoryResource): Column<any>
  • Interleave Series columns of a table into a single column. Converts the column major table cols into a row major column.

    Parameters

    • Optional memoryResource: MemoryResource

      An optional MemoryResource used to allocate the result's device memory.

    Returns Column<any>

orderBy

  • orderBy(column_orders: boolean[], null_orders: boolean[], memoryResource?: MemoryResource): Column<Int32>
  • Generate an ordering that sorts Table columns in a specified way

    Parameters

    • column_orders: boolean[]

      The desired sort order for each column. Size must be equal to numColumns.

    • null_orders: boolean[]

      Indicates how null values compare against all other values in a column

    • Optional memoryResource: MemoryResource

      An optional MemoryResource used to allocate the result's device memory.

    Returns Column<Int32>

    Column of permutation indices for the desired sort order

scatterScalar

  • Scatters row of values into this Table according to provided indices.

    Type parameters

    • T: Scalar<any>[]

    Parameters

    • source: T

      A column of values to be scattered in to this Series

    • indices: Column<IndexType>

      A column of integral indices that indicate the rows in the this Series to be replaced by value.

    • Optional memoryResource: MemoryResource

      An optional MemoryResource used to allocate the result's device memory.

    Returns Table

scatterTable

  • Scatters a Table of values into this Table according to provided indices.

    Parameters

    • source: Table
    • indices: Column<IndexType>

      A column of integral indices that indicate the rows in the this Series to be replaced by value.

    • Optional memoryResource: MemoryResource

      An optional MemoryResource used to allocate the result's device memory.

    Returns Table

toArrow

unique

  • summary

    Create a new table with consecutive duplicate rows removed.

    Parameters

    • keys: number[]

      List of column indices on which to operate.

    • keep: DuplicateKeepOption

      Determines whether to keep the first, last, or none of the duplicate items.

    • nullsEqual: boolean

      Determines whether nulls are handled as equal values.

    • Optional memoryResource: MemoryResource

      An optional MemoryResource used to allocate the result's device memory.

    Returns Table

writeCSV

writeORC

  • writeORC(filePath: string, options: TableWriteORCOptions): void
  • Write a Table to Apache ORC file format.

    Parameters

    • filePath: string

      File path or root directory path.

    • options: TableWriteORCOptions

      Options controlling ORC writing behavior.

    Returns void

writeParquet

  • writeParquet(filePath: string, options: TableWriteParquetOptions): void
  • Write a Table to Apache Parquet file format.

    Parameters

    • filePath: string

      File path or root directory path.

    • options: TableWriteParquetOptions

      Options controlling parquet writing behavior.

    Returns void