Options
All
  • Public
  • Public/Protected
  • All
Menu

Data-Forge

Index

Type aliases

AggregateFn

AggregateFn: function

Defines a function for aggregation.

Type declaration

    • (accum: ToT, value: ValueT): ToT
    • Parameters

      • accum: ToT
      • value: ValueT

      Returns ToT

CallbackFn

CallbackFn: function

A callback function that can be applied to each value.

Type declaration

    • (value: ValueT, index: number): void
    • Parameters

      • value: ValueT
      • index: number

      Returns void

ComparerFn

ComparerFn: function

Compares to values and returns true if they are equivalent.

Type declaration

    • (a: ValueT1, b: ValueT2): boolean
    • Parameters

      • a: ValueT1
      • b: ValueT2

      Returns boolean

DataFrameConfigFn

DataFrameConfigFn: function

Type declaration

GapFillFn

GapFillFn: function

Type declaration

    • (a: ValueT, b: ValueT): ResultT[]
    • Parameters

      • a: ValueT
      • b: ValueT

      Returns ResultT[]

JoinFn

JoinFn: function

A function that joins to vlaues.

Type declaration

    • (a: ValueT1, b: ValueT2): ResultT
    • Parameters

      • a: ValueT1
      • b: ValueT2

      Returns ResultT

PredicateFn

PredicateFn: function

A predicate function, returns true or false based on input. A predicate function for testing a value against another.

Type declaration

    • (value: any, against: any): boolean
    • Parameters

      • value: any
      • against: any

      Returns boolean

SelectorFn

SelectorFn: function

A selector function with no index. Transforms a value into another kind of value.

Type declaration

    • (value: FromT): ToT
    • Parameters

      • value: FromT

      Returns ToT

SelectorWithIndexFn

SelectorWithIndexFn: function

A selector function. Transforms a value into another kind of value.

Type declaration

    • (value: FromT, index: number): ToT
    • Parameters

      • value: FromT
      • index: number

      Returns ToT

SeriesConfigFn

SeriesConfigFn: function

Type declaration

SeriesSelectorFn

SeriesSelectorFn: function

A selector function that can select a series from a dataframe.

Type declaration

    • Parameters

      Returns ISeries<IndexT, SeriesValueT>

Zip2Fn

Zip2Fn: function

Type declaration

    • (a: T1, b: T2): ReturnT
    • Parameters

      • a: T1
      • b: T2

      Returns ReturnT

Zip3Fn

Zip3Fn: function

Type declaration

    • (a: T1, b: T2, c: T3): ReturnT
    • Parameters

      • a: T1
      • b: T2
      • c: T3

      Returns ReturnT

Zip4Fn

Zip4Fn: function

Type declaration

    • (a: T1, b: T2, c: T3, d: T4): ReturnT
    • Parameters

      • a: T1
      • b: T2
      • c: T3
      • d: T4

      Returns ReturnT

Zip5Fn

Zip5Fn: function

Type declaration

    • (a: T1, b: T2, c: T3, d: T4): ReturnT
    • Parameters

      • a: T1
      • b: T2
      • c: T3
      • d: T4

      Returns ReturnT

ZipNFn

ZipNFn: function

Functions to zip together multiple values.

Type declaration

    • (input: ISeries<number, ValueT>): ReturnT
    • Parameters

      Returns ReturnT

Functions

fromCSV

  • Deserialize a DataFrame from a CSV text string.

    Parameters

    • csvTextString: string

      The CSV text to deserialize.

    • Optional config: ICSVOptions

    Returns DataFrame<number, any>

    Returns a dataframe that has been deserialized from the CSV data.

fromJSON

  • fromJSON(jsonTextString: string): IDataFrame<number, any>
  • Deserialize a dataframe from a JSON text string.

    Parameters

    • jsonTextString: string

      The JSON text to deserialize.

    Returns IDataFrame<number, any>

    Returns a dataframe that has been deserialized from the JSON data.

fromObject

  • Convert a regular JavaScript obejct to a dataframe. Each row in the dataframe represents a field from the object.

    Parameters

    • obj: any

      The JavaScript object to convert to a dataframe.

    Returns IDataFrame<number, IFieldRecord>

    Returns a dataframe that lists the fields in the pass-in object.

matrix

  • matrix(numColumns: number, numRows: number, start: number, increment: number): IDataFrame<number, any>
  • Generate a data-frame containing a matrix of values.

    Parameters

    • numColumns: number

      The number of columns in the data-frame.

    • numRows: number

      The number of rows in the data-frame.

    • start: number

      The starting value.

    • increment: number

      The value to increment by for each new value.

    Returns IDataFrame<number, any>

    Returns a dataframe that contains a matrix of generated values.

range

  • range(start: number, count: number): ISeries<number, number>
  • Generate a series from a range of numbers.

    Parameters

    • start: number

      The value of the first number in the range.

    • count: number

      The number of sequential values in the range.

    Returns ISeries<number, number>

    Returns a series with a sequence of generated values. The series contains 'count' values beginning at 'start'.

readFile

  • Read a file asynchronously from the file system. Works in Nodejs, doesn't work in the browser.

    Parameters

    • filePath: string

      The path to the file to read.

    Returns IAsyncFileReader

    Returns an object that represents the file. Use parseCSV or parseJSON to deserialize to a DataFrame.

readFileSync

  • Read a file synchronously from the file system. Works in Nodejs, doesn't work in the browser.

    Parameters

    • filePath: string

      The path to the file to read.

    Returns ISyncFileReader

    Returns an object that represents the file. Use parseCSV or parseJSON to deserialize to a DataFrame.

Generated using TypeDoc