DataFrame

DataFrame

An interface to the wobbegong representation of a DataFrame instance. This should contain columns of integer, double, string or boolean arrays of the same length. It may also contain row names.

Constructor

new DataFrame(summary, path, fetch_range)

Source:
Parameters:
Name Type Description
summary object

A summary of the DataFrame contents, according to the wobbegong specifications.

path string

Path to the DataFrame directory. This may be a relative or absolute path, depending on how the files are hosted.

fetch_range function

A function that accepts file (a path to a file inside path), start and end. It should retrieve bytes from file in the interval [start, end) and return a Uint8Array containing those bytes. It may also return a promise that resolves to such a Uint8Array.

Classes

DataFrame

Methods

(async) column(i, optionsopt) → {object|Array|Int32Array|Float64Array}

Source:
Parameters:
Name Type Attributes Default Description
i number | string

Index or name of the column to retrieve.

options object <optional>
{}

Further options.

Properties
Name Type Attributes Default Description
type boolean <optional>
false

Whether to include the type of the column.

missing string <optional>
"null"

How to handle missing values for integer arrays, see the corresponding option in decodeIntegers.

Returns:

If type = false, an array containing the contents of column i. If type = true, this is instead an object containing type, a string with the column type; and value, an array with the column contents.

Type
object | Array | Int32Array | Float64Array

columnNames(optionsopt) → {Array}

Source:
Parameters:
Name Type Attributes Default Description
options object <optional>
{}

Further options.

Properties
Name Type Attributes Default Description
types boolean <optional>
false

Whether to include the types of the columns.

Returns:

Names of the columns. If types = true, each entry is an object specifying the name and type of the column; otherwise, each entry is a string.

Type
Array

hasRowNames() → {boolean}

Source:
Returns:

Whether this DataFrame has row names.

Type
boolean

numberOfColumns() → {number}

Source:
Returns:

Number of columns.

Type
number

numberOfRows() → {number}

Source:
Returns:

Number of rows.

Type
number

(async) rowNames() → (nullable) {Array}

Source:
Returns:

Names of the rows, or null if there are no row names.

Type
Array