Skip to content
This repository has been archived by the owner on May 17, 2018. It is now read-only.

Latest commit

 

History

History
3748 lines (2763 loc) · 201 KB

api.md

File metadata and controls

3748 lines (2763 loc) · 201 KB

Objects

dataForge : object

Main namespace for Data-Forge.

Nodejs:

    npm install --save data-forge
var dataForge = require('data-forge');

Browser:

    bower install --save data-forge

    <script language="javascript" type="text/javascript" src="bower_components/data-forge/data-forge.js"></script>

Functions

parseCSV([config])Promise.<DataFrame>

Deserialize a CSV file to a DataFrame. Returns a promise that later resolves to a DataFrame.

parseJSON([config])Promise.<DataFrame>

Deserialize a JSON file to a DataFrame. Returns a promise that later resolves to a DataFrame.

parseCSV([config])DataFrame

Deserialize a CSV file to a DataFrame.

parseJSON([config])DataFrame

Deserialize a JSON file to a DataFrame.

parseCSV([config])Promise.<DataFrame>

Deserialize a CSV data to a DataFrame.

parseJSON([config])Promise.<DataFrame>

Deserialize JSON data to a DataFrame.

writeFile(filePath)Promise

Serialize the dataframe to a CSV file in the local file system. Asynchronous version.

writeFileSync(filePath)

Serialize the dataframe to a CSV file in the local file system. Synchronous version.

httpPost(url)Promise

Serialize the dataframe to CSV and HTTP POST it to the specified REST API.

writeFile(filePath)Promise

Serialize the dataframe to a JSON file in the local file system. Asynchronous version.

writeFileSync(filePath)

Serialize the dataframe to a JSON file in the local file system. Synchronous version.

httpPost(url)Promise

Serialize the dataframe to JSON and HTTP POST it to the specified REST API.

dataForge : object

Main namespace for Data-Forge.

Nodejs:

	npm install --save data-forge
	
	var dataForge = require('data-forge');

Browser:

	bower install --save data-forge

	<script language="javascript" type="text/javascript" src="bower_components/data-forge/data-forge.js"></script>

Kind: global namespace

dataForge.DataFrame ⇐ Series

Kind: static class of dataForge
Extends: Series

new DataFrame(config|values)

Constructor for DataFrame.

Param Type Description
config values object | array

dataFrame.thenBy ⇒ Series | DataFrame

Performs additional sorting (ascending).

Kind: instance property of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe that has been sorted by the value returned by the selector.
Access: public

Param Type Description
sortSelector function Selects the value to sort by.

dataFrame.thenByDescending ⇒ Series | DataFrame

Performs additional sorting (descending).

Kind: instance property of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe that has been sorted by the value returned by the selector.
Access: public

Param Type Description
sortSelector function Selects the value to sort by.

dataFrame.getColumnNames() ⇒ array

Get the names of the columns in the data frame.

Kind: instance method of DataFrame
Returns: array - Returns an array of the column names in the dataframe.

dataFrame.getColumnIndex(columnName) ⇒ int

Gets a column index from a column name.

Kind: instance method of DataFrame
Returns: int - Returns the index of the named column or -1 if the requested column was not found.

Param Type Description
columnName string The name of the column to retrieve the column index for.

dataFrame.getColumnName(columnIndex) ⇒ string

Gets a column name from a column index.

Kind: instance method of DataFrame
Returns: string - Returns the name of the column or undefined if the requested column was not found.

Param Type Description
columnIndex int The index of the column to retrieve the column name for.

dataFrame.getSeries(columnName)

Retreive a time-series from a column of the data-frame.

Kind: instance method of DataFrame

Param Type Description
columnName string Specifies the column to retreive.

dataFrame.hasSeries(columnName)

Returns true if the column with the requested name exists in the data frame.

Kind: instance method of DataFrame

Param Type Description
columnName string Name of the column to check.

dataFrame.expectSeries(columnName)

Verify the existance of a column and return it. Throws an exception if the column doesn't exist.

Kind: instance method of DataFrame

Param Type Description
columnName string Name or index of the column to retreive.

dataFrame.ensureSeries(columnNameOrSpec, seriesOrFn) ⇒ DataFrame

Add a series if it doesn't already exist.

Kind: instance method of DataFrame
Returns: DataFrame - Returns a new dataframe with the specified series added, if the series didn't already exist. Otherwise if the requested series already exists the same dataframe is returned.

Param Type Description
columnNameOrSpec string | object The name of the series to add or a column spec that defines the new column.
seriesOrFn function The series to add or a function that returns the series.

dataFrame.getColumns() ⇒ array

Retreive a collection of all columns.

Kind: instance method of DataFrame
Returns: array - Returns an array of the columns in the dataframe.

dataFrame.subset(columnNames) ⇒ DataFrame

Create a new data-frame from a subset of columns.

Kind: instance method of DataFrame
Returns: DataFrame - Returns a dataframe with a subset of columns from the input dataframe.

Param Type Description
columnNames array Array of column names to include in the new data-frame.

dataFrame.dropSeries(columnOrColumns) ⇒ DataFrame

Create a new data frame with the requested column or columns dropped.

Kind: instance method of DataFrame
Returns: DataFrame - Returns a new dataframe with a particular name column or columns removed.

Param Type Description
columnOrColumns string | array Specifies the column name (a string) or columns (array of column names) to drop.

dataFrame.withSeries(columnNameOrSpec, [seriesOrFn]) ⇒ DataFrame

Create a new data frame with an additional column specified by the passed-in series.

Kind: instance method of DataFrame
Returns: DataFrame - Returns a new dataframe replacing or adding a particular named column.

Param Type Description
columnNameOrSpec string | object The name of the column to add or replace.
[seriesOrFn] Series | function When columnNameOrSpec is a string that identifies the column to add, this specifies the Series to add to the data-frame or a function that produces a series (given a dataframe).

dataFrame.setIndex(columnName) ⇒ DataFrame

Set a named column as the index of the data-frame.

Kind: instance method of DataFrame
Returns: DataFrame - Returns a new dataframe with the values of a particular named column as the index.

Param Type Description
columnName string Name or index of the column to set as the index.

dataFrame.toString() ⇒ string

Format the data frame for display as a string.

Kind: instance method of DataFrame
Overrides: toString
Returns: string - Returns a string representation of the dataframe for logging.

dataFrame.parseInts(columnNameOrNames) ⇒ DataFrame

Parse a column with string values to a column with int values.

Kind: instance method of DataFrame
Overrides: parseInts
Returns: DataFrame - Returns a new dataframe with a particular named column parsed as ints.

Param Type Description
columnNameOrNames string | array Specifies the column name or array of column names to parse.

dataFrame.parseFloats(columnNameOrNames) ⇒ DataFrame

Parse a column with string values to a column with float values.

Kind: instance method of DataFrame
Overrides: parseFloats
Returns: DataFrame - Returns a new dataframe with a particular named column parsed as floats.

Param Type Description
columnNameOrNames string | array Specifies the column name or array of column names to parse.

dataFrame.parseDates(columnNameOrNames, [formatString]) ⇒ DataFrame

Parse a column with string values to a column with date values.

Kind: instance method of DataFrame
Overrides: parseDates
Returns: DataFrame - Returns a new dataframe with a particular named column parsed as dates.

Param Type Description
columnNameOrNames string | array Specifies the column name or array of column names to parse.
[formatString] string Optional formatting string for dates.

dataFrame.toStrings(columnNameOrNames, [formatString]) ⇒ DataFrame

Convert a column of values of different types to a column of string values.

Kind: instance method of DataFrame
Overrides: toStrings
Returns: DataFrame - Returns a new dataframe with a particular named column convert to strings.

Param Type Description
columnNameOrNames string | array Specifies the column name or array of column names to convert to strings.
[formatString] string Optional formatting string for dates.

dataFrame.detectTypes() ⇒ DataFrame

Detect the types of the values in the sequence.

Kind: instance method of DataFrame
Overrides: detectTypes
Returns: DataFrame - Returns a dataframe that describes the data types contained in the input series or dataframe.

dataFrame.detectValues() ⇒ DataFrame

Detect values and their frequencies contained within columns in the data frame. Detect the frequency of values in the sequence.

Kind: instance method of DataFrame
Overrides: detectValues
Returns: DataFrame - Returns a dataframe that describes the values contained in the input sequence.

dataFrame.truncateStrings(maxLength) ⇒ DataFrame

Produces a new data frame with all string values truncated to the requested maximum length.

Kind: instance method of DataFrame
Overrides: truncateStrings
Returns: DataFrame - Returns a new dataframe with all strings truncated to the specified maximum length.

Param Type Description
maxLength int The maximum length of the string values after truncation.

dataFrame.reorderSeries(columnNames) ⇒ DataFrame

Create a new data frame with columns reordered. New column names create new columns (with undefined values), omitting existing column names causes those columns to be dropped.

Kind: instance method of DataFrame
Returns: DataFrame - Returns a new dataframe with columns remapped according to the specified column layout.

Param Type Description
columnNames array The new order for columns.

dataFrame.renameSeries(newColumnNames|columnsMap) ⇒ DataFrame

Create a new data-frame with renamed series.

Kind: instance method of DataFrame
Returns: DataFrame - Returns a new dataframe with columns renamed.

Param Type Description
newColumnNames columnsMap array | object

dataFrame.toJSON() ⇒ string

Serialize the data frame to JSON.

Kind: instance method of DataFrame
Returns: string - Returns a JSON format string representing the dataframe.

dataFrame.toCSV() ⇒ string

Serialize the data frame to CSV.

Kind: instance method of DataFrame
Returns: string - Returns a CSV format string representing the dataframe.

dataFrame.asCSV() ⇒ object

Treat the dataframe as CSV data for purposes of serialization.

Kind: instance method of DataFrame
Returns: object - Returns an object that represents the dataframe for serialization in the CSV format. Call writeFile, writeFileSync or httpPost to output the dataframe via different media.

dataFrame.asJSON() ⇒ object

Treat the dataframe as JSON data for purposes of serialization.

Kind: instance method of DataFrame
Returns: object - Returns an object that represents the dataframe for serialization in the JSON format. Call writeFile, writeFileSync or httpPost to output the dataframe via different media.

dataFrame.toHTML() ⇒ string

Serialize the data frame to HTML.

Kind: instance method of DataFrame
Returns: string - Returns a HTML format string representing the dataframe.

dataFrame.transformSeries(columnSelectors) ⇒ DataFrame

Transform one or more columns. This is equivalent to extracting a column, calling 'select' on it, then plugging it back in as the same column.

Kind: instance method of DataFrame
Returns: DataFrame - Returns a new dataframe with 1 or more columns transformed.

Param Type Description
columnSelectors object Object with field names for each column to be transformed. Each field you be a selector that transforms that column.

dataFrame.generateSeries(generator) ⇒ DataFrame

Generate new columns based on existing rows.

Kind: instance method of DataFrame
Returns: DataFrame - Returns a new dataframe with 1 or more new columns.

Param Type Description
generator function | object Generator function that transforms each row to a new set of columns.

dataFrame.deflate(selector) ⇒ Series

Deflate a data-frame to a series.

Kind: instance method of DataFrame
Returns: Series - Returns a series that was created from the input dataframe.

Param Type Description
selector function Selector function that transforms each row to a new sequence of values.

dataFrame.inflateSeries(columnName, [selector]) ⇒ DataFrame

Inflate a named series in the data-frame to 1 or more new series.

Kind: instance method of DataFrame
Returns: DataFrame - Returns a new dataframe with a column inflated to 1 or more new columns.

Param Type Description
columnName string Name or index of the column to retreive.
[selector] function Optional selector function that transforms each value in the column to new columns. If not specified it is expected that each value in the column is an object whose fields define the new column names.

dataFrame.aggregate([seed], selector) ⇒ DataFrame

Aggregate the rows of the data-frame.

Kind: instance method of DataFrame
Overrides: aggregate
Returns: DataFrame - Returns a new dataframe with a column inflated to 1 or more new columns.

Param Type Description
[seed] object The seed value for producing the aggregation.
selector function Function that takes the seed and then each row in the data-frame and produces the aggregate value.

dataFrame.bringToFront(columnOrColumns) ⇒ DataFrame

Bring the name column to the front, making it the first column in the data-frame.

Kind: instance method of DataFrame
Returns: DataFrame - Returns a new dataframe with 1 or more columns bought to the front of the column ordering.

Param Type Description
columnOrColumns string | array Specifies the column or columns to bring to the front.

dataFrame.bringToBack(columnOrColumns) ⇒ DataFrame

Bring the name column to the back, making it the last column in the data-frame.

Kind: instance method of DataFrame
Returns: DataFrame - Returns a new dataframe with 1 or more columns bought to the back of the column ordering.

Param Type Description
columnOrColumns string | array Specifies the column or columns to bring to the back.

dataFrame.pivot(column, value) ⇒ DataFrame

Reshape (or pivot) a table based on column values.

Kind: instance method of DataFrame
Returns: DataFrame - Returns a new dataframe that has been pivoted based on a particular column's values.

Param Type Description
column string Column name whose values make the new DataFrame's columns.
value string Column name whose values populate the new DataFrame's values.

dataFrame.concat(dataFrames) ⇒ DataFrame

Concatenate multiple other dataframes onto this dataframe.

Kind: instance method of DataFrame
Overrides: concat
Returns: DataFrame - Returns a single dataframe concatenated from multiple input dataframes.

Param Type Description
dataFrames array | DataFrame Multiple arguments. Each can be either a dataframe or an array of dataframe.

dataFrame.toRows() ⇒ array

Bake the data frame to an array of rows.

Kind: instance method of DataFrame
Returns: array - Returns an array of rows. Each row is an array of values in column order.

dataFrame.getIterator() ⇒ iterator

Get an iterator for index & values of the series.

Kind: instance method of DataFrame
Returns: iterator - Returns an iterator that can be used to enumerate and lazily evalute the contents of the series or dataframe.

dataFrame.getIndex() ⇒ Series

Retreive the index of the series.

Kind: instance method of DataFrame
Returns: Series - Returns a new series that contains the values of the index for this series.

dataFrame.withIndex(newIndex) ⇒ Series | DataFrame

Apply a new index to the Series.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe with the specified index attached.

Param Type Description
newIndex array | Series The new index to apply to the Series.

dataFrame.resetIndex() ⇒ Series | DataFrame

Reset the index of the data frame back to the default sequential integer index.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe with the index reset to the default zero-based index.

dataFrame.skip(numRows) ⇒ Series | DataFrame

Skip a number of rows in the series.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe with the specified number of values skipped.

Param Type Description
numRows int Number of rows to skip.

dataFrame.skipWhile(predicate) ⇒ Series | DataFrame

Skips values in the series while a condition is met.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe with all initial sequential values removed that match the predicate.

Param Type Description
predicate function Return true to indicate the condition met.

dataFrame.skipUntil(predicate) ⇒ Series | DataFrame

Skips values in the series until a condition is met.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe with all initial sequential values removed that don't match the predicate.

Param Type Description
predicate function Return true to indicate the condition met.

dataFrame.take(numRows) ⇒ Series | DataFrame

Take a number of rows in the series.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe with up to the specified number of values included.

Param Type Description
numRows int Number of rows to take.

dataFrame.takeWhile(predicate) ⇒ Series | DataFrame

Take values from the series while a condition is met.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe that only includes the initial sequential values that have matched the predicate.

Param Type Description
predicate function Return true to indicate the condition met.

dataFrame.takeUntil(predicate) ⇒ Series | DataFrame

Take values from the series until a condition is met.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe that only includes the initial sequential values that have not matched the predicate.

Param Type Description
predicate function Return true to indicate the condition met.

dataFrame.where(predicate) ⇒ Series | DataFrame

Filter a series by a predicate selector.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe containing only the values that match the predicate.

Param Type Description
predicate function Predicte function to filter rows of the series.

dataFrame.select(selector) ⇒ Series | DataFrame

Generate a new series based on the results of the selector function.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe that has been transformed by the selector function.

Param Type Description
selector function Selector function that transforms each value to create a new series or dataframe.

dataFrame.selectMany(generator) ⇒ Series | DataFrame

Generate a new series based on the results of the selector function.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe with values that have been produced by the generator function.

Param Type Description
generator function Generator function that may generator 0 or more new values from value in the series or dataframe.

dataFrame.orderBy(sortSelector) ⇒ Series | DataFrame

Sorts the series or dataframe (ascending).

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe that has been sorted by the value returned by the selector.

Param Type Description
sortSelector function Selects the value to sort by.

dataFrame.orderByDescending(sortSelector) ⇒ Series | DataFrame

Sorts the series or dataframe (descending).

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe that has been sorted by the value returned by the selector.

Param Type Description
sortSelector function Selects the value to sort by.

dataFrame.window(period) ⇒ Series

Segment a Series into 'windows'. Returns a new Series. Each value in the new Series contains a 'window' (or segment) of the original series or dataframe. Use select or selectPairs to aggregate.

Kind: instance method of DataFrame
Returns: Series - Returns a new series, each value of which is a 'window' (or segment) of the original series or dataframe.

Param Type Description
period integer The number of values in the window.

dataFrame.rollingWindow(period) ⇒ Series

Segment a Series into 'rolling windows'. Returns a new Series. Each value in the new Series contains a 'window' (or segment) of the original Series. Use select or selectPairs to aggregate.

Kind: instance method of DataFrame
Returns: Series - Returns a new series, each value of which is a 'window' (or segment) of the original series or dataframe.

Param Type Description
period integer The number of values in the window.

dataFrame.percentChange() ⇒ Series

Compute the percent change for each row after the first. Percentages are expressed as 0-1 values.

Kind: instance method of DataFrame
Returns: Series - Returns a new series where each value indicates the percent change from the previous number value in the original series.

dataFrame.bake() ⇒ Series | DataFrame

Forces lazy evaluation to complete and 'bakes' the series into memory.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a series or dataframe that has been 'baked', all lazy evaluation has completed.

dataFrame.toPairs() ⇒ array

Retreive the data as pairs of [index, value].

Kind: instance method of DataFrame
Returns: array - Returns an array of pairs for the content of the series or dataframe. Each pair is a two element array that contains an index and a value.

dataFrame.count() ⇒ array

Count the number of rows in the series.

Kind: instance method of DataFrame
Returns: array - Returns the count of all values in the series or dataframes.

dataFrame.first() ⇒ value

Get the first value of the series or dataframe.

Kind: instance method of DataFrame
Returns: value - Returns the first value of the series or dataframe.

dataFrame.last() ⇒ value

Get the last value of the series or dataframe.

Kind: instance method of DataFrame
Returns: value - Returns the last value of the series or dataframe.

dataFrame.reverse() ⇒ Series | DataFrame

Reverse the series or dataframe.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe that is the reverse of the input.

dataFrame.inflate([selector]) ⇒ DataFrame

Inflate a series to a data-frame.

Kind: instance method of DataFrame
Returns: DataFrame - Returns a new dataframe that has been created from the input series via the 'selector' function.

Param Type Description
[selector] function Optional selector function that transforms each value in the series to a row in the new data-frame.

dataFrame.head(values) ⇒ Series | DataFrame

Get X values from the start of the series or dataframe.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe that has only the specified number of values taken from the start of the input sequence.

Param Type Description
values int Number of values to take.

dataFrame.tail(values) ⇒ Series | DataFrame

Get X values from the end of the series or dataframe.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe that has only the specified number of values taken from the end of the input sequence.

Param Type Description
values int Number of values to take.

dataFrame.sum() ⇒ number

Sum the values in a series.

Kind: instance method of DataFrame
Returns: number - Returns the sum of the number values in the series.

dataFrame.average() ⇒ number

Average the values in a series.

Kind: instance method of DataFrame
Returns: number - Returns the average of the number values in the series.

dataFrame.median() ⇒ Number

Get the median value in the series. Not this sorts the series, so can be expensive.

Kind: instance method of DataFrame
Returns: Number - Returns the median of the values in the series.

dataFrame.min() ⇒ number

Get the min value in the series.

Kind: instance method of DataFrame
Returns: number - Returns the minimum of the number values in the series.

dataFrame.max() ⇒ number

Get the max value in the series.

Kind: instance method of DataFrame
Returns: number - Returns the maximum of the number values in the series.

dataFrame.toObject(keySelector, keySelector) ⇒ object

Convert the series to a JavaScript object.

Kind: instance method of DataFrame
Returns: object - Returns a JavaScript object generated from the input sequence by the key and value selector funtions.

Param Type Description
keySelector function Function that selects keys for the resulting object.
keySelector valueSelector Function that selects values for the resulting object.

dataFrame.zip(sequence, selector) ⇒ Series | DataFrame

Zip together multiple series or dataframes to produce a new series or dataframe.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a single series or dataframe that is the combination of multiple input sequences that have been 'zipped' together by the 'selector' function.

Param Type Description
sequence Series | DataFrame Multiple parameters, one for each sequence to be zipped.
selector function Selector function that produces a new series or dataframe based on the inputs.

dataFrame.forEach(callback) ⇒ Series | DataFrame

Invoke a callback function for each value in the series.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns the input sequence with no modifications.

Param Type Description
callback function The calback to invoke for each value.

dataFrame.all(predicate) ⇒ boolean

Determine if the predicate returns truthy for all values in the sequence. Returns false as soon as the predicate evaluates to falsy. Returns true if the predicate returns truthy for all values in the Series. Returns false if the series is empty.

Kind: instance method of DataFrame
Returns: boolean - Returns true if the predicate has returned truthy for every value in the sequence, otherwise returns false.

Param Type Description
predicate function Predicate function that receives each value in turn and returns truthy for a match, otherwise falsy.

dataFrame.any([predicate]) ⇒ boolean

Determine if the predicate returns truthy for any of the values in the sequence. Returns true as soon as the predicate returns truthy. Returns false if the predicate never returns truthy. If no predicate is specified the value itself is checked.

Kind: instance method of DataFrame
Returns: boolean - Returns true if the predicate has returned truthy for any value in the sequence, otherwise returns false.

Param Type Description
[predicate] function Optional predicate function that receives each value in turn and returns truthy for a match, otherwise falsy.

dataFrame.none([predicate]) ⇒ boolean

Determine if the predicate returns truthy for none of the values in the sequence. Returns true for an empty Series. Returns true if the predicate always returns falsy. Otherwise returns false. If no predicate is specified the value itself is checked.

Kind: instance method of DataFrame
Returns: boolean - Returns true if the predicate has returned truthy for no values in the sequence, otherwise returns false.

Param Type Description
[predicate] function Optional predicate function that receives each value in turn and returns truthy for a match, otherwise falsy.

dataFrame.sequentialDistinct(selector) ⇒ Series | DataFrame

Group sequential duplicate values into a Series of windows.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a series of groups. Each group is itself a series or dataframe.

Param Type Description
selector function Selects the value used to compare for duplicates.

dataFrame.distinct(selector) ⇒ Series | DataFrame

Group distinct values in the Series into a Series of windows.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a series or dataframe containing only unique values as determined by the 'selector' function.

Param Type Description
selector function Selects the value used to compare for duplicates.

dataFrame.variableWindow(comparer) ⇒ Series | DataFrame

Groups sequential values into variable length 'windows'. The windows can then be transformed/transformed using selectPairs or selectManyPairs.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a series of groups. Each group is itself a series or dataframe that contains the values in the 'window'.

Param Type Description
comparer function Predicate that compares two values and returns true if they should be in the same window.

dataFrame.insertPair(pair) ⇒ Series | DataFrame

Insert a pair at the start of a Series.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe with the specified pair inserted.

Param Type Description
pair pair The pair to insert.

dataFrame.appendPair(pair) ⇒ Series | DataFrame

Append a pair to the end of a Series.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe with the specified pair appended.

Param Type Description
pair pair The pair to append.

dataFrame.fillGaps(predicate, generator) ⇒ Series

Fill gaps in a series or dataframe.

Kind: instance method of DataFrame
Returns: Series - Returns a new series with gaps filled in.

Param Type Description
predicate function Predicate that is passed pairA and pairB, two consecutive rows, return truthy if there is a gap between the rows, or falsey if there is no gap.
generator function Generator that is passed pairA and pairB, two consecutive rows, returns an array of pairs that fills the gap between the rows.

dataFrame.groupBy(selector) ⇒ Series

Group the series according to the selector.

Kind: instance method of DataFrame
Returns: Series - Returns a series of groups. Each group is a series with values that have been grouped by the 'selector' function.

Param Type Description
selector function Selector that defines the value to group by.

dataFrame.groupSequentialBy(selector) ⇒ Series

Group sequential values into a Series of windows.

Kind: instance method of DataFrame
Returns: Series - Returns a series of groups. Each group is a series with values that have been grouped by the 'selector' function.

Param Type Description
selector function Selector that defines the value to group by.

dataFrame.at(index) ⇒ value

Get the value at a specified index.

Kind: instance method of DataFrame
Returns: value - Returns the value from the specified index in the sequence.

Param Type Description
index function Index to for which to retreive the value.

dataFrame.join(self, inner, outerKeySelector, innerKeySelector, resultSelector) ⇒ Series | DataFrame

Correlates the elements of two Series or DataFrames based on matching keys.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns the joined series or dataframe.

Param Type Description
self Series | DataFrame The outer Series or DataFrame to join.
inner Series | DataFrame The inner Series or DataFrame to join.
outerKeySelector function Selector that chooses the join key from the outer sequence.
innerKeySelector function Selector that chooses the join key from the inner sequence.
resultSelector function Selector that defines how to merge outer and inner values.

dataFrame.joinOuter(self, inner, outerKeySelector, innerKeySelector, outerResultSelector, innerResultSelector, mergeSelector) ⇒ Series | DataFrame

Performs an outer join on two Series or DataFrames. Correlates the elements based on matching keys. Includes elements that have no correlation.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns the joined series or dataframe.

Param Type Description
self Series | DataFrame The outer Series or DataFrame to join.
inner Series | DataFrame The inner Series or DataFrame to join.
outerKeySelector function Selector that chooses the join key from the outer sequence.
innerKeySelector function Selector that chooses the join key from the inner sequence.
outerResultSelector function Selector that defines how to extract the outer value before joining it with the inner value.
innerResultSelector function Selector that defines how to extract the inner value before joining it with the outer value.
mergeSelector function Selector that defines how to combine left and right. Implementation from here: http://blogs.geniuscode.net/RyanDHatch/?p=116

dataFrame.joinOuterLeft(self, inner, outerKeySelector, innerKeySelector, outerResultSelector, innerResultSelector, mergeSelector) ⇒ Series | DataFrame

Performs a left outer join on two Series or DataFrames. Correlates the elements based on matching keys. Includes left elements that have no correlation.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns the joined series or dataframe.

Param Type Description
self Series | DataFrame The outer Series or DataFrame to join.
inner Series | DataFrame The inner Series or DataFrame to join.
outerKeySelector function Selector that chooses the join key from the outer sequence.
innerKeySelector function Selector that chooses the join key from the inner sequence.
outerResultSelector function Selector that defines how to extract the outer value before joining it with the inner value.
innerResultSelector function Selector that defines how to extract the inner value before joining it with the outer value.
mergeSelector function Selector that defines how to combine left and right. Implementation from here: http://blogs.geniuscode.net/RyanDHatch/?p=116

dataFrame.joinOuterRight(self, inner, outerKeySelector, innerKeySelector, outerResultSelector, innerResultSelector, mergeSelector) ⇒ Series | DataFrame

Performs a right outer join on two Series or DataFrames. Correlates the elements based on matching keys. Includes right elements that have no correlation.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns the joined series or dataframe.

Param Type Description
self Series | DataFrame The outer Series or DataFrame to join.
inner Series | DataFrame The inner Series or DataFrame to join.
outerKeySelector function Selector that chooses the join key from the outer sequence.
innerKeySelector function Selector that chooses the join key from the inner sequence.
outerResultSelector function Selector that defines how to extract the outer value before joining it with the inner value.
innerResultSelector function Selector that defines how to extract the inner value before joining it with the outer value.
mergeSelector function Selector that defines how to combine left and right. Implementation from here: http://blogs.geniuscode.net/RyanDHatch/?p=116

dataFrame.defaultIfEmpty(defaultSequence) ⇒ Series | DataFrame

Returns the specified default sequence if the Series or DataFrame is empty.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns 'defaultSequence' if the input sequence is empty.

Param Type Description
defaultSequence array | Series | DataFrame Default sequence to return if the Series or DataFrame is empty.

dataFrame.union(other, [comparer]) ⇒ Series | DataFrame

Returns the unique union of values between two Series or DataFrames.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns the union of two sequences.

Param Type Description
other Series | DataFrame The other Series or DataFrame to combine.
[comparer] function Optional comparer that selects the value to compare.

dataFrame.intersection(other, [comparer]) ⇒ Series | DataFrame

Returns the intersection of values between two Series or DataFrames.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns the intersection of two sequences.

Param Type Description
other Series | DataFrame The other Series or DataFrame to combine.
[comparer] function Optional comparer that selects the value to compare.

dataFrame.except(other, [comparer]) ⇒ Series | DataFrame

Returns the exception of values between two Series or DataFrames.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns the difference of one sequence to another.

Param Type Description
other Series | DataFrame The other Series or DataFrame to combine.
[comparer] function Optional comparer that selects the value to compare.

dataFrame.asPairs() ⇒ Pairs

Convert a series or a dataframe to a series of pairs in the form [pair1, pair2, pair3, ...] where each pair is [index, value].

Kind: instance method of DataFrame
Returns: Pairs - Returns a series of pairs for each index and value pair in the input sequence.

dataFrame.startAt(indexValue) ⇒ Series | DataFrame

Get a new series or dataframe starting at the specified index value.

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe with all values after the specified index.

Param Type Description
indexValue value The value to search for before starting the new Series or DataFrame.

dataFrame.endAt(indexValue) ⇒ Series | DataFrame

Get a new series or dataframe ending at the specified index value (inclusive).

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe with values up to and including the specified index.

Param Type Description
indexValue value The value to search for before ending the new Series or DataFrame.

dataFrame.before(indexValue) ⇒ Series | DataFrame

Get a new series or dataframe with all values before the specified index value (exclusive).

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe with all values before the specified index.

Param Type Description
indexValue value The value to search for while taking values.

dataFrame.after(indexValue) ⇒ Series | DataFrame

Get a new series or dataframe with all values after the specified index value (exclusive).

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe with all values before the specified index.

Param Type Description
indexValue value The value to search for while taking values.

dataFrame.between(startIndexValue, endIndexValue) ⇒ Series | DataFrame

Get a new series or dataframe with all values between the specified index values (inclusive).

Kind: instance method of DataFrame
Returns: Series | DataFrame - Returns a new series or dataframe with all values before the specified index.

Param Type Description
startIndexValue value The index where the new sequence starts.
endIndexValue value The index where the new sequence ends.

dataForge.Index ⇐ Series

Kind: static class of dataForge
Extends: Series

new Index(config|values)

Constructor for Index.

Param Type Description
config values object | array

index.thenBy ⇒ Series | DataFrame

Performs additional sorting (ascending).

Kind: instance property of Index
Returns: Series | DataFrame - Returns a new series or dataframe that has been sorted by the value returned by the selector.
Access: public

Param Type Description
sortSelector function Selects the value to sort by.

index.thenByDescending ⇒ Series | DataFrame

Performs additional sorting (descending).

Kind: instance property of Index
Returns: Series | DataFrame - Returns a new series or dataframe that has been sorted by the value returned by the selector.
Access: public

Param Type Description
sortSelector function Selects the value to sort by.

index.getType() ⇒ string

Get the type of the index.

Kind: instance method of Index
Returns: string - Returns a string that specifies the type of the index.

index.getLessThan() ⇒ function

Get the less than operation for the index.

Kind: instance method of Index
Returns: function - Returns a function that can be used to compare a value against an index value.

index.getGreaterThan() ⇒ function

Get the greater than operation for the index.

Kind: instance method of Index
Returns: function - Returns a function that can be used to compare a value against an index value.

index.getIterator() ⇒ iterator

Get an iterator for index & values of the series.

Kind: instance method of Index
Returns: iterator - Returns an iterator that can be used to enumerate and lazily evalute the contents of the series or dataframe.

index.getIndex() ⇒ Series

Retreive the index of the series.

Kind: instance method of Index
Returns: Series - Returns a new series that contains the values of the index for this series.

index.withIndex(newIndex) ⇒ Series | DataFrame

Apply a new index to the Series.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe with the specified index attached.

Param Type Description
newIndex array | Series The new index to apply to the Series.

index.resetIndex() ⇒ Series | DataFrame

Reset the index of the data frame back to the default sequential integer index.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe with the index reset to the default zero-based index.

index.skip(numRows) ⇒ Series | DataFrame

Skip a number of rows in the series.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe with the specified number of values skipped.

Param Type Description
numRows int Number of rows to skip.

index.skipWhile(predicate) ⇒ Series | DataFrame

Skips values in the series while a condition is met.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe with all initial sequential values removed that match the predicate.

Param Type Description
predicate function Return true to indicate the condition met.

index.skipUntil(predicate) ⇒ Series | DataFrame

Skips values in the series until a condition is met.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe with all initial sequential values removed that don't match the predicate.

Param Type Description
predicate function Return true to indicate the condition met.

index.take(numRows) ⇒ Series | DataFrame

Take a number of rows in the series.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe with up to the specified number of values included.

Param Type Description
numRows int Number of rows to take.

index.takeWhile(predicate) ⇒ Series | DataFrame

Take values from the series while a condition is met.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe that only includes the initial sequential values that have matched the predicate.

Param Type Description
predicate function Return true to indicate the condition met.

index.takeUntil(predicate) ⇒ Series | DataFrame

Take values from the series until a condition is met.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe that only includes the initial sequential values that have not matched the predicate.

Param Type Description
predicate function Return true to indicate the condition met.

index.where(predicate) ⇒ Series | DataFrame

Filter a series by a predicate selector.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe containing only the values that match the predicate.

Param Type Description
predicate function Predicte function to filter rows of the series.

index.select(selector) ⇒ Series | DataFrame

Generate a new series based on the results of the selector function.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe that has been transformed by the selector function.

Param Type Description
selector function Selector function that transforms each value to create a new series or dataframe.

index.selectMany(generator) ⇒ Series | DataFrame

Generate a new series based on the results of the selector function.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe with values that have been produced by the generator function.

Param Type Description
generator function Generator function that may generator 0 or more new values from value in the series or dataframe.

index.orderBy(sortSelector) ⇒ Series | DataFrame

Sorts the series or dataframe (ascending).

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe that has been sorted by the value returned by the selector.

Param Type Description
sortSelector function Selects the value to sort by.

index.orderByDescending(sortSelector) ⇒ Series | DataFrame

Sorts the series or dataframe (descending).

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe that has been sorted by the value returned by the selector.

Param Type Description
sortSelector function Selects the value to sort by.

index.window(period) ⇒ Series

Segment a Series into 'windows'. Returns a new Series. Each value in the new Series contains a 'window' (or segment) of the original series or dataframe. Use select or selectPairs to aggregate.

Kind: instance method of Index
Returns: Series - Returns a new series, each value of which is a 'window' (or segment) of the original series or dataframe.

Param Type Description
period integer The number of values in the window.

index.rollingWindow(period) ⇒ Series

Segment a Series into 'rolling windows'. Returns a new Series. Each value in the new Series contains a 'window' (or segment) of the original Series. Use select or selectPairs to aggregate.

Kind: instance method of Index
Returns: Series - Returns a new series, each value of which is a 'window' (or segment) of the original series or dataframe.

Param Type Description
period integer The number of values in the window.

index.toString() ⇒ string

Format the data frame for display as a string.

Kind: instance method of Index
Returns: string - Generates and returns a string representation of the series or dataframe.

index.percentChange() ⇒ Series

Compute the percent change for each row after the first. Percentages are expressed as 0-1 values.

Kind: instance method of Index
Returns: Series - Returns a new series where each value indicates the percent change from the previous number value in the original series.

index.parseInts() ⇒ Series

Parse a series with string values to a series with int values.

Kind: instance method of Index
Returns: Series - Returns a new series where string values from the original series have been parsed to integer values.

index.parseFloats() ⇒ Series

Parse a series with string values to a series with float values.

Kind: instance method of Index
Returns: Series - Returns a new series where string values from the original series have been parsed to floating-point values.

index.parseDates([formatString]) ⇒ Series

Parse a series with string values to a series with date values.

Kind: instance method of Index
Returns: Series - Returns a new series where string values from the original series have been parsed to Date values.

Param Type Description
[formatString] string Optional formatting string for dates.

index.toStrings([formatString]) ⇒ Series

Convert a series of values of different types to a series of string values.

Kind: instance method of Index
Returns: Series - Returns a new series where the values from the original series have been stringified.

Param Type Description
[formatString] string Optional formatting string for dates.

index.detectTypes() ⇒ DataFrame

Detect the types of the values in the sequence.

Kind: instance method of Index
Returns: DataFrame - Returns a dataframe that describes the data types contained in the input series or dataframe.

index.detectValues() ⇒ DataFrame

Detect the frequency of values in the sequence.

Kind: instance method of Index
Returns: DataFrame - Returns a dataframe that describes the values contained in the input sequence.

index.truncateStrings(maxLength) ⇒ Series

Produces a new series with all string values truncated to the requested maximum length.

Kind: instance method of Index
Returns: Series - Returns a new series with strings that are truncated to the specified maximum length.

Param Type Description
maxLength int The maximum length of the string values after truncation.

index.bake() ⇒ Series | DataFrame

Forces lazy evaluation to complete and 'bakes' the series into memory.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a series or dataframe that has been 'baked', all lazy evaluation has completed.

index.toPairs() ⇒ array

Retreive the data as pairs of [index, value].

Kind: instance method of Index
Returns: array - Returns an array of pairs for the content of the series or dataframe. Each pair is a two element array that contains an index and a value.

index.count() ⇒ array

Count the number of rows in the series.

Kind: instance method of Index
Returns: array - Returns the count of all values in the series or dataframes.

index.first() ⇒ value

Get the first value of the series or dataframe.

Kind: instance method of Index
Returns: value - Returns the first value of the series or dataframe.

index.last() ⇒ value

Get the last value of the series or dataframe.

Kind: instance method of Index
Returns: value - Returns the last value of the series or dataframe.

index.reverse() ⇒ Series | DataFrame

Reverse the series or dataframe.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe that is the reverse of the input.

index.inflate([selector]) ⇒ DataFrame

Inflate a series to a data-frame.

Kind: instance method of Index
Returns: DataFrame - Returns a new dataframe that has been created from the input series via the 'selector' function.

Param Type Description
[selector] function Optional selector function that transforms each value in the series to a row in the new data-frame.

index.head(values) ⇒ Series | DataFrame

Get X values from the start of the series or dataframe.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe that has only the specified number of values taken from the start of the input sequence.

Param Type Description
values int Number of values to take.

index.tail(values) ⇒ Series | DataFrame

Get X values from the end of the series or dataframe.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe that has only the specified number of values taken from the end of the input sequence.

Param Type Description
values int Number of values to take.

index.sum() ⇒ number

Sum the values in a series.

Kind: instance method of Index
Returns: number - Returns the sum of the number values in the series.

index.average() ⇒ number

Average the values in a series.

Kind: instance method of Index
Returns: number - Returns the average of the number values in the series.

index.median() ⇒ Number

Get the median value in the series. Not this sorts the series, so can be expensive.

Kind: instance method of Index
Returns: Number - Returns the median of the values in the series.

index.min() ⇒ number

Get the min value in the series.

Kind: instance method of Index
Returns: number - Returns the minimum of the number values in the series.

index.max() ⇒ number

Get the max value in the series.

Kind: instance method of Index
Returns: number - Returns the maximum of the number values in the series.

index.aggregate([seed], selector) ⇒ value

Aggregate the values in the series.

Kind: instance method of Index
Returns: value - Returns a new value that has been aggregated from the input sequence by the 'selector' function.

Param Type Description
[seed] object The seed value for producing the aggregation.
selector function Function that takes the seed and then each value in the series and produces the aggregate value.

index.toObject(keySelector, keySelector) ⇒ object

Convert the series to a JavaScript object.

Kind: instance method of Index
Returns: object - Returns a JavaScript object generated from the input sequence by the key and value selector funtions.

Param Type Description
keySelector function Function that selects keys for the resulting object.
keySelector valueSelector Function that selects values for the resulting object.

index.zip(sequence, selector) ⇒ Series | DataFrame

Zip together multiple series or dataframes to produce a new series or dataframe.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a single series or dataframe that is the combination of multiple input sequences that have been 'zipped' together by the 'selector' function.

Param Type Description
sequence Series | DataFrame Multiple parameters, one for each sequence to be zipped.
selector function Selector function that produces a new series or dataframe based on the inputs.

index.forEach(callback) ⇒ Series | DataFrame

Invoke a callback function for each value in the series.

Kind: instance method of Index
Returns: Series | DataFrame - Returns the input sequence with no modifications.

Param Type Description
callback function The calback to invoke for each value.

index.all(predicate) ⇒ boolean

Determine if the predicate returns truthy for all values in the sequence. Returns false as soon as the predicate evaluates to falsy. Returns true if the predicate returns truthy for all values in the Series. Returns false if the series is empty.

Kind: instance method of Index
Returns: boolean - Returns true if the predicate has returned truthy for every value in the sequence, otherwise returns false.

Param Type Description
predicate function Predicate function that receives each value in turn and returns truthy for a match, otherwise falsy.

index.any([predicate]) ⇒ boolean

Determine if the predicate returns truthy for any of the values in the sequence. Returns true as soon as the predicate returns truthy. Returns false if the predicate never returns truthy. If no predicate is specified the value itself is checked.

Kind: instance method of Index
Returns: boolean - Returns true if the predicate has returned truthy for any value in the sequence, otherwise returns false.

Param Type Description
[predicate] function Optional predicate function that receives each value in turn and returns truthy for a match, otherwise falsy.

index.none([predicate]) ⇒ boolean

Determine if the predicate returns truthy for none of the values in the sequence. Returns true for an empty Series. Returns true if the predicate always returns falsy. Otherwise returns false. If no predicate is specified the value itself is checked.

Kind: instance method of Index
Returns: boolean - Returns true if the predicate has returned truthy for no values in the sequence, otherwise returns false.

Param Type Description
[predicate] function Optional predicate function that receives each value in turn and returns truthy for a match, otherwise falsy.

index.sequentialDistinct(selector) ⇒ Series | DataFrame

Group sequential duplicate values into a Series of windows.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a series of groups. Each group is itself a series or dataframe.

Param Type Description
selector function Selects the value used to compare for duplicates.

index.distinct(selector) ⇒ Series | DataFrame

Group distinct values in the Series into a Series of windows.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a series or dataframe containing only unique values as determined by the 'selector' function.

Param Type Description
selector function Selects the value used to compare for duplicates.

index.variableWindow(comparer) ⇒ Series | DataFrame

Groups sequential values into variable length 'windows'. The windows can then be transformed/transformed using selectPairs or selectManyPairs.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a series of groups. Each group is itself a series or dataframe that contains the values in the 'window'.

Param Type Description
comparer function Predicate that compares two values and returns true if they should be in the same window.

index.insertPair(pair) ⇒ Series | DataFrame

Insert a pair at the start of a Series.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe with the specified pair inserted.

Param Type Description
pair pair The pair to insert.

index.appendPair(pair) ⇒ Series | DataFrame

Append a pair to the end of a Series.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe with the specified pair appended.

Param Type Description
pair pair The pair to append.

index.fillGaps(predicate, generator) ⇒ Series

Fill gaps in a series or dataframe.

Kind: instance method of Index
Returns: Series - Returns a new series with gaps filled in.

Param Type Description
predicate function Predicate that is passed pairA and pairB, two consecutive rows, return truthy if there is a gap between the rows, or falsey if there is no gap.
generator function Generator that is passed pairA and pairB, two consecutive rows, returns an array of pairs that fills the gap between the rows.

index.groupBy(selector) ⇒ Series

Group the series according to the selector.

Kind: instance method of Index
Returns: Series - Returns a series of groups. Each group is a series with values that have been grouped by the 'selector' function.

Param Type Description
selector function Selector that defines the value to group by.

index.groupSequentialBy(selector) ⇒ Series

Group sequential values into a Series of windows.

Kind: instance method of Index
Returns: Series - Returns a series of groups. Each group is a series with values that have been grouped by the 'selector' function.

Param Type Description
selector function Selector that defines the value to group by.

index.at(index) ⇒ value

Get the value at a specified index.

Kind: instance method of Index
Returns: value - Returns the value from the specified index in the sequence.

Param Type Description
index function Index to for which to retreive the value.

index.concat(series) ⇒ Series

Concatenate multiple other series onto this series.

Kind: instance method of Index
Returns: Series - Returns a single series concatenated from multiple input series.

Param Type Description
series array | Series Multiple arguments. Each can be either a series or an array of series.

index.join(self, inner, outerKeySelector, innerKeySelector, resultSelector) ⇒ Series | DataFrame

Correlates the elements of two Series or DataFrames based on matching keys.

Kind: instance method of Index
Returns: Series | DataFrame - Returns the joined series or dataframe.

Param Type Description
self Series | DataFrame The outer Series or DataFrame to join.
inner Series | DataFrame The inner Series or DataFrame to join.
outerKeySelector function Selector that chooses the join key from the outer sequence.
innerKeySelector function Selector that chooses the join key from the inner sequence.
resultSelector function Selector that defines how to merge outer and inner values.

index.joinOuter(self, inner, outerKeySelector, innerKeySelector, outerResultSelector, innerResultSelector, mergeSelector) ⇒ Series | DataFrame

Performs an outer join on two Series or DataFrames. Correlates the elements based on matching keys. Includes elements that have no correlation.

Kind: instance method of Index
Returns: Series | DataFrame - Returns the joined series or dataframe.

Param Type Description
self Series | DataFrame The outer Series or DataFrame to join.
inner Series | DataFrame The inner Series or DataFrame to join.
outerKeySelector function Selector that chooses the join key from the outer sequence.
innerKeySelector function Selector that chooses the join key from the inner sequence.
outerResultSelector function Selector that defines how to extract the outer value before joining it with the inner value.
innerResultSelector function Selector that defines how to extract the inner value before joining it with the outer value.
mergeSelector function Selector that defines how to combine left and right. Implementation from here: http://blogs.geniuscode.net/RyanDHatch/?p=116

index.joinOuterLeft(self, inner, outerKeySelector, innerKeySelector, outerResultSelector, innerResultSelector, mergeSelector) ⇒ Series | DataFrame

Performs a left outer join on two Series or DataFrames. Correlates the elements based on matching keys. Includes left elements that have no correlation.

Kind: instance method of Index
Returns: Series | DataFrame - Returns the joined series or dataframe.

Param Type Description
self Series | DataFrame The outer Series or DataFrame to join.
inner Series | DataFrame The inner Series or DataFrame to join.
outerKeySelector function Selector that chooses the join key from the outer sequence.
innerKeySelector function Selector that chooses the join key from the inner sequence.
outerResultSelector function Selector that defines how to extract the outer value before joining it with the inner value.
innerResultSelector function Selector that defines how to extract the inner value before joining it with the outer value.
mergeSelector function Selector that defines how to combine left and right. Implementation from here: http://blogs.geniuscode.net/RyanDHatch/?p=116

index.joinOuterRight(self, inner, outerKeySelector, innerKeySelector, outerResultSelector, innerResultSelector, mergeSelector) ⇒ Series | DataFrame

Performs a right outer join on two Series or DataFrames. Correlates the elements based on matching keys. Includes right elements that have no correlation.

Kind: instance method of Index
Returns: Series | DataFrame - Returns the joined series or dataframe.

Param Type Description
self Series | DataFrame The outer Series or DataFrame to join.
inner Series | DataFrame The inner Series or DataFrame to join.
outerKeySelector function Selector that chooses the join key from the outer sequence.
innerKeySelector function Selector that chooses the join key from the inner sequence.
outerResultSelector function Selector that defines how to extract the outer value before joining it with the inner value.
innerResultSelector function Selector that defines how to extract the inner value before joining it with the outer value.
mergeSelector function Selector that defines how to combine left and right. Implementation from here: http://blogs.geniuscode.net/RyanDHatch/?p=116

index.defaultIfEmpty(defaultSequence) ⇒ Series | DataFrame

Returns the specified default sequence if the Series or DataFrame is empty.

Kind: instance method of Index
Returns: Series | DataFrame - Returns 'defaultSequence' if the input sequence is empty.

Param Type Description
defaultSequence array | Series | DataFrame Default sequence to return if the Series or DataFrame is empty.

index.union(other, [comparer]) ⇒ Series | DataFrame

Returns the unique union of values between two Series or DataFrames.

Kind: instance method of Index
Returns: Series | DataFrame - Returns the union of two sequences.

Param Type Description
other Series | DataFrame The other Series or DataFrame to combine.
[comparer] function Optional comparer that selects the value to compare.

index.intersection(other, [comparer]) ⇒ Series | DataFrame

Returns the intersection of values between two Series or DataFrames.

Kind: instance method of Index
Returns: Series | DataFrame - Returns the intersection of two sequences.

Param Type Description
other Series | DataFrame The other Series or DataFrame to combine.
[comparer] function Optional comparer that selects the value to compare.

index.except(other, [comparer]) ⇒ Series | DataFrame

Returns the exception of values between two Series or DataFrames.

Kind: instance method of Index
Returns: Series | DataFrame - Returns the difference of one sequence to another.

Param Type Description
other Series | DataFrame The other Series or DataFrame to combine.
[comparer] function Optional comparer that selects the value to compare.

index.asPairs() ⇒ Pairs

Convert a series or a dataframe to a series of pairs in the form [pair1, pair2, pair3, ...] where each pair is [index, value].

Kind: instance method of Index
Returns: Pairs - Returns a series of pairs for each index and value pair in the input sequence.

index.startAt(indexValue) ⇒ Series | DataFrame

Get a new series or dataframe starting at the specified index value.

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe with all values after the specified index.

Param Type Description
indexValue value The value to search for before starting the new Series or DataFrame.

index.endAt(indexValue) ⇒ Series | DataFrame

Get a new series or dataframe ending at the specified index value (inclusive).

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe with values up to and including the specified index.

Param Type Description
indexValue value The value to search for before ending the new Series or DataFrame.

index.before(indexValue) ⇒ Series | DataFrame

Get a new series or dataframe with all values before the specified index value (exclusive).

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe with all values before the specified index.

Param Type Description
indexValue value The value to search for while taking values.

index.after(indexValue) ⇒ Series | DataFrame

Get a new series or dataframe with all values after the specified index value (exclusive).

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe with all values before the specified index.

Param Type Description
indexValue value The value to search for while taking values.

index.between(startIndexValue, endIndexValue) ⇒ Series | DataFrame

Get a new series or dataframe with all values between the specified index values (inclusive).

Kind: instance method of Index
Returns: Series | DataFrame - Returns a new series or dataframe with all values before the specified index.

Param Type Description
startIndexValue value The index where the new sequence starts.
endIndexValue value The index where the new sequence ends.

dataForge.Series

Kind: static class of dataForge

new Series(config|values)

Constructor for Series.

Param Type Description
config values object | array

series.thenBy ⇒ Series | DataFrame

Performs additional sorting (ascending).

Kind: instance property of Series
Returns: Series | DataFrame - Returns a new series or dataframe that has been sorted by the value returned by the selector.
Access: public

Param Type Description
sortSelector function Selects the value to sort by.

series.thenByDescending ⇒ Series | DataFrame

Performs additional sorting (descending).

Kind: instance property of Series
Returns: Series | DataFrame - Returns a new series or dataframe that has been sorted by the value returned by the selector.
Access: public

Param Type Description
sortSelector function Selects the value to sort by.

series.getIterator() ⇒ iterator

Get an iterator for index & values of the series.

Kind: instance method of Series
Returns: iterator - Returns an iterator that can be used to enumerate and lazily evalute the contents of the series or dataframe.

series.getIndex() ⇒ Series

Retreive the index of the series.

Kind: instance method of Series
Returns: Series - Returns a new series that contains the values of the index for this series.

series.withIndex(newIndex) ⇒ Series | DataFrame

Apply a new index to the Series.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe with the specified index attached.

Param Type Description
newIndex array | Series The new index to apply to the Series.

series.resetIndex() ⇒ Series | DataFrame

Reset the index of the data frame back to the default sequential integer index.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe with the index reset to the default zero-based index.

series.skip(numRows) ⇒ Series | DataFrame

Skip a number of rows in the series.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe with the specified number of values skipped.

Param Type Description
numRows int Number of rows to skip.

series.skipWhile(predicate) ⇒ Series | DataFrame

Skips values in the series while a condition is met.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe with all initial sequential values removed that match the predicate.

Param Type Description
predicate function Return true to indicate the condition met.

series.skipUntil(predicate) ⇒ Series | DataFrame

Skips values in the series until a condition is met.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe with all initial sequential values removed that don't match the predicate.

Param Type Description
predicate function Return true to indicate the condition met.

series.take(numRows) ⇒ Series | DataFrame

Take a number of rows in the series.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe with up to the specified number of values included.

Param Type Description
numRows int Number of rows to take.

series.takeWhile(predicate) ⇒ Series | DataFrame

Take values from the series while a condition is met.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe that only includes the initial sequential values that have matched the predicate.

Param Type Description
predicate function Return true to indicate the condition met.

series.takeUntil(predicate) ⇒ Series | DataFrame

Take values from the series until a condition is met.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe that only includes the initial sequential values that have not matched the predicate.

Param Type Description
predicate function Return true to indicate the condition met.

series.where(predicate) ⇒ Series | DataFrame

Filter a series by a predicate selector.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe containing only the values that match the predicate.

Param Type Description
predicate function Predicte function to filter rows of the series.

series.select(selector) ⇒ Series | DataFrame

Generate a new series based on the results of the selector function.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe that has been transformed by the selector function.

Param Type Description
selector function Selector function that transforms each value to create a new series or dataframe.

series.selectMany(generator) ⇒ Series | DataFrame

Generate a new series based on the results of the selector function.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe with values that have been produced by the generator function.

Param Type Description
generator function Generator function that may generator 0 or more new values from value in the series or dataframe.

series.orderBy(sortSelector) ⇒ Series | DataFrame

Sorts the series or dataframe (ascending).

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe that has been sorted by the value returned by the selector.

Param Type Description
sortSelector function Selects the value to sort by.

series.orderByDescending(sortSelector) ⇒ Series | DataFrame

Sorts the series or dataframe (descending).

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe that has been sorted by the value returned by the selector.

Param Type Description
sortSelector function Selects the value to sort by.

series.window(period) ⇒ Series

Segment a Series into 'windows'. Returns a new Series. Each value in the new Series contains a 'window' (or segment) of the original series or dataframe. Use select or selectPairs to aggregate.

Kind: instance method of Series
Returns: Series - Returns a new series, each value of which is a 'window' (or segment) of the original series or dataframe.

Param Type Description
period integer The number of values in the window.

series.rollingWindow(period) ⇒ Series

Segment a Series into 'rolling windows'. Returns a new Series. Each value in the new Series contains a 'window' (or segment) of the original Series. Use select or selectPairs to aggregate.

Kind: instance method of Series
Returns: Series - Returns a new series, each value of which is a 'window' (or segment) of the original series or dataframe.

Param Type Description
period integer The number of values in the window.

series.toString() ⇒ string

Format the data frame for display as a string.

Kind: instance method of Series
Returns: string - Generates and returns a string representation of the series or dataframe.

series.percentChange() ⇒ Series

Compute the percent change for each row after the first. Percentages are expressed as 0-1 values.

Kind: instance method of Series
Returns: Series - Returns a new series where each value indicates the percent change from the previous number value in the original series.

series.parseInts() ⇒ Series

Parse a series with string values to a series with int values.

Kind: instance method of Series
Returns: Series - Returns a new series where string values from the original series have been parsed to integer values.

series.parseFloats() ⇒ Series

Parse a series with string values to a series with float values.

Kind: instance method of Series
Returns: Series - Returns a new series where string values from the original series have been parsed to floating-point values.

series.parseDates([formatString]) ⇒ Series

Parse a series with string values to a series with date values.

Kind: instance method of Series
Returns: Series - Returns a new series where string values from the original series have been parsed to Date values.

Param Type Description
[formatString] string Optional formatting string for dates.

series.toStrings([formatString]) ⇒ Series

Convert a series of values of different types to a series of string values.

Kind: instance method of Series
Returns: Series - Returns a new series where the values from the original series have been stringified.

Param Type Description
[formatString] string Optional formatting string for dates.

series.detectTypes() ⇒ DataFrame

Detect the types of the values in the sequence.

Kind: instance method of Series
Returns: DataFrame - Returns a dataframe that describes the data types contained in the input series or dataframe.

series.detectValues() ⇒ DataFrame

Detect the frequency of values in the sequence.

Kind: instance method of Series
Returns: DataFrame - Returns a dataframe that describes the values contained in the input sequence.

series.truncateStrings(maxLength) ⇒ Series

Produces a new series with all string values truncated to the requested maximum length.

Kind: instance method of Series
Returns: Series - Returns a new series with strings that are truncated to the specified maximum length.

Param Type Description
maxLength int The maximum length of the string values after truncation.

series.bake() ⇒ Series | DataFrame

Forces lazy evaluation to complete and 'bakes' the series into memory.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a series or dataframe that has been 'baked', all lazy evaluation has completed.

series.toPairs() ⇒ array

Retreive the data as pairs of [index, value].

Kind: instance method of Series
Returns: array - Returns an array of pairs for the content of the series or dataframe. Each pair is a two element array that contains an index and a value.

series.count() ⇒ array

Count the number of rows in the series.

Kind: instance method of Series
Returns: array - Returns the count of all values in the series or dataframes.

series.first() ⇒ value

Get the first value of the series or dataframe.

Kind: instance method of Series
Returns: value - Returns the first value of the series or dataframe.

series.last() ⇒ value

Get the last value of the series or dataframe.

Kind: instance method of Series
Returns: value - Returns the last value of the series or dataframe.

series.reverse() ⇒ Series | DataFrame

Reverse the series or dataframe.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe that is the reverse of the input.

series.inflate([selector]) ⇒ DataFrame

Inflate a series to a data-frame.

Kind: instance method of Series
Returns: DataFrame - Returns a new dataframe that has been created from the input series via the 'selector' function.

Param Type Description
[selector] function Optional selector function that transforms each value in the series to a row in the new data-frame.

series.head(values) ⇒ Series | DataFrame

Get X values from the start of the series or dataframe.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe that has only the specified number of values taken from the start of the input sequence.

Param Type Description
values int Number of values to take.

series.tail(values) ⇒ Series | DataFrame

Get X values from the end of the series or dataframe.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe that has only the specified number of values taken from the end of the input sequence.

Param Type Description
values int Number of values to take.

series.sum() ⇒ number

Sum the values in a series.

Kind: instance method of Series
Returns: number - Returns the sum of the number values in the series.

series.average() ⇒ number

Average the values in a series.

Kind: instance method of Series
Returns: number - Returns the average of the number values in the series.

series.median() ⇒ Number

Get the median value in the series. Not this sorts the series, so can be expensive.

Kind: instance method of Series
Returns: Number - Returns the median of the values in the series.

series.min() ⇒ number

Get the min value in the series.

Kind: instance method of Series
Returns: number - Returns the minimum of the number values in the series.

series.max() ⇒ number

Get the max value in the series.

Kind: instance method of Series
Returns: number - Returns the maximum of the number values in the series.

series.aggregate([seed], selector) ⇒ value

Aggregate the values in the series.

Kind: instance method of Series
Returns: value - Returns a new value that has been aggregated from the input sequence by the 'selector' function.

Param Type Description
[seed] object The seed value for producing the aggregation.
selector function Function that takes the seed and then each value in the series and produces the aggregate value.

series.toObject(keySelector, keySelector) ⇒ object

Convert the series to a JavaScript object.

Kind: instance method of Series
Returns: object - Returns a JavaScript object generated from the input sequence by the key and value selector funtions.

Param Type Description
keySelector function Function that selects keys for the resulting object.
keySelector valueSelector Function that selects values for the resulting object.

series.zip(sequence, selector) ⇒ Series | DataFrame

Zip together multiple series or dataframes to produce a new series or dataframe.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a single series or dataframe that is the combination of multiple input sequences that have been 'zipped' together by the 'selector' function.

Param Type Description
sequence Series | DataFrame Multiple parameters, one for each sequence to be zipped.
selector function Selector function that produces a new series or dataframe based on the inputs.

series.forEach(callback) ⇒ Series | DataFrame

Invoke a callback function for each value in the series.

Kind: instance method of Series
Returns: Series | DataFrame - Returns the input sequence with no modifications.

Param Type Description
callback function The calback to invoke for each value.

series.all(predicate) ⇒ boolean

Determine if the predicate returns truthy for all values in the sequence. Returns false as soon as the predicate evaluates to falsy. Returns true if the predicate returns truthy for all values in the Series. Returns false if the series is empty.

Kind: instance method of Series
Returns: boolean - Returns true if the predicate has returned truthy for every value in the sequence, otherwise returns false.

Param Type Description
predicate function Predicate function that receives each value in turn and returns truthy for a match, otherwise falsy.

series.any([predicate]) ⇒ boolean

Determine if the predicate returns truthy for any of the values in the sequence. Returns true as soon as the predicate returns truthy. Returns false if the predicate never returns truthy. If no predicate is specified the value itself is checked.

Kind: instance method of Series
Returns: boolean - Returns true if the predicate has returned truthy for any value in the sequence, otherwise returns false.

Param Type Description
[predicate] function Optional predicate function that receives each value in turn and returns truthy for a match, otherwise falsy.

series.none([predicate]) ⇒ boolean

Determine if the predicate returns truthy for none of the values in the sequence. Returns true for an empty Series. Returns true if the predicate always returns falsy. Otherwise returns false. If no predicate is specified the value itself is checked.

Kind: instance method of Series
Returns: boolean - Returns true if the predicate has returned truthy for no values in the sequence, otherwise returns false.

Param Type Description
[predicate] function Optional predicate function that receives each value in turn and returns truthy for a match, otherwise falsy.

series.sequentialDistinct(selector) ⇒ Series | DataFrame

Group sequential duplicate values into a Series of windows.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a series of groups. Each group is itself a series or dataframe.

Param Type Description
selector function Selects the value used to compare for duplicates.

series.distinct(selector) ⇒ Series | DataFrame

Group distinct values in the Series into a Series of windows.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a series or dataframe containing only unique values as determined by the 'selector' function.

Param Type Description
selector function Selects the value used to compare for duplicates.

series.variableWindow(comparer) ⇒ Series | DataFrame

Groups sequential values into variable length 'windows'. The windows can then be transformed/transformed using selectPairs or selectManyPairs.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a series of groups. Each group is itself a series or dataframe that contains the values in the 'window'.

Param Type Description
comparer function Predicate that compares two values and returns true if they should be in the same window.

series.insertPair(pair) ⇒ Series | DataFrame

Insert a pair at the start of a Series.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe with the specified pair inserted.

Param Type Description
pair pair The pair to insert.

series.appendPair(pair) ⇒ Series | DataFrame

Append a pair to the end of a Series.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe with the specified pair appended.

Param Type Description
pair pair The pair to append.

series.fillGaps(predicate, generator) ⇒ Series

Fill gaps in a series or dataframe.

Kind: instance method of Series
Returns: Series - Returns a new series with gaps filled in.

Param Type Description
predicate function Predicate that is passed pairA and pairB, two consecutive rows, return truthy if there is a gap between the rows, or falsey if there is no gap.
generator function Generator that is passed pairA and pairB, two consecutive rows, returns an array of pairs that fills the gap between the rows.

series.groupBy(selector) ⇒ Series

Group the series according to the selector.

Kind: instance method of Series
Returns: Series - Returns a series of groups. Each group is a series with values that have been grouped by the 'selector' function.

Param Type Description
selector function Selector that defines the value to group by.

series.groupSequentialBy(selector) ⇒ Series

Group sequential values into a Series of windows.

Kind: instance method of Series
Returns: Series - Returns a series of groups. Each group is a series with values that have been grouped by the 'selector' function.

Param Type Description
selector function Selector that defines the value to group by.

series.at(index) ⇒ value

Get the value at a specified index.

Kind: instance method of Series
Returns: value - Returns the value from the specified index in the sequence.

Param Type Description
index function Index to for which to retreive the value.

series.concat(series) ⇒ Series

Concatenate multiple other series onto this series.

Kind: instance method of Series
Returns: Series - Returns a single series concatenated from multiple input series.

Param Type Description
series array | Series Multiple arguments. Each can be either a series or an array of series.

series.join(self, inner, outerKeySelector, innerKeySelector, resultSelector) ⇒ Series | DataFrame

Correlates the elements of two Series or DataFrames based on matching keys.

Kind: instance method of Series
Returns: Series | DataFrame - Returns the joined series or dataframe.

Param Type Description
self Series | DataFrame The outer Series or DataFrame to join.
inner Series | DataFrame The inner Series or DataFrame to join.
outerKeySelector function Selector that chooses the join key from the outer sequence.
innerKeySelector function Selector that chooses the join key from the inner sequence.
resultSelector function Selector that defines how to merge outer and inner values.

series.joinOuter(self, inner, outerKeySelector, innerKeySelector, outerResultSelector, innerResultSelector, mergeSelector) ⇒ Series | DataFrame

Performs an outer join on two Series or DataFrames. Correlates the elements based on matching keys. Includes elements that have no correlation.

Kind: instance method of Series
Returns: Series | DataFrame - Returns the joined series or dataframe.

Param Type Description
self Series | DataFrame The outer Series or DataFrame to join.
inner Series | DataFrame The inner Series or DataFrame to join.
outerKeySelector function Selector that chooses the join key from the outer sequence.
innerKeySelector function Selector that chooses the join key from the inner sequence.
outerResultSelector function Selector that defines how to extract the outer value before joining it with the inner value.
innerResultSelector function Selector that defines how to extract the inner value before joining it with the outer value.
mergeSelector function Selector that defines how to combine left and right. Implementation from here: http://blogs.geniuscode.net/RyanDHatch/?p=116

series.joinOuterLeft(self, inner, outerKeySelector, innerKeySelector, outerResultSelector, innerResultSelector, mergeSelector) ⇒ Series | DataFrame

Performs a left outer join on two Series or DataFrames. Correlates the elements based on matching keys. Includes left elements that have no correlation.

Kind: instance method of Series
Returns: Series | DataFrame - Returns the joined series or dataframe.

Param Type Description
self Series | DataFrame The outer Series or DataFrame to join.
inner Series | DataFrame The inner Series or DataFrame to join.
outerKeySelector function Selector that chooses the join key from the outer sequence.
innerKeySelector function Selector that chooses the join key from the inner sequence.
outerResultSelector function Selector that defines how to extract the outer value before joining it with the inner value.
innerResultSelector function Selector that defines how to extract the inner value before joining it with the outer value.
mergeSelector function Selector that defines how to combine left and right. Implementation from here: http://blogs.geniuscode.net/RyanDHatch/?p=116

series.joinOuterRight(self, inner, outerKeySelector, innerKeySelector, outerResultSelector, innerResultSelector, mergeSelector) ⇒ Series | DataFrame

Performs a right outer join on two Series or DataFrames. Correlates the elements based on matching keys. Includes right elements that have no correlation.

Kind: instance method of Series
Returns: Series | DataFrame - Returns the joined series or dataframe.

Param Type Description
self Series | DataFrame The outer Series or DataFrame to join.
inner Series | DataFrame The inner Series or DataFrame to join.
outerKeySelector function Selector that chooses the join key from the outer sequence.
innerKeySelector function Selector that chooses the join key from the inner sequence.
outerResultSelector function Selector that defines how to extract the outer value before joining it with the inner value.
innerResultSelector function Selector that defines how to extract the inner value before joining it with the outer value.
mergeSelector function Selector that defines how to combine left and right. Implementation from here: http://blogs.geniuscode.net/RyanDHatch/?p=116

series.defaultIfEmpty(defaultSequence) ⇒ Series | DataFrame

Returns the specified default sequence if the Series or DataFrame is empty.

Kind: instance method of Series
Returns: Series | DataFrame - Returns 'defaultSequence' if the input sequence is empty.

Param Type Description
defaultSequence array | Series | DataFrame Default sequence to return if the Series or DataFrame is empty.

series.union(other, [comparer]) ⇒ Series | DataFrame

Returns the unique union of values between two Series or DataFrames.

Kind: instance method of Series
Returns: Series | DataFrame - Returns the union of two sequences.

Param Type Description
other Series | DataFrame The other Series or DataFrame to combine.
[comparer] function Optional comparer that selects the value to compare.

series.intersection(other, [comparer]) ⇒ Series | DataFrame

Returns the intersection of values between two Series or DataFrames.

Kind: instance method of Series
Returns: Series | DataFrame - Returns the intersection of two sequences.

Param Type Description
other Series | DataFrame The other Series or DataFrame to combine.
[comparer] function Optional comparer that selects the value to compare.

series.except(other, [comparer]) ⇒ Series | DataFrame

Returns the exception of values between two Series or DataFrames.

Kind: instance method of Series
Returns: Series | DataFrame - Returns the difference of one sequence to another.

Param Type Description
other Series | DataFrame The other Series or DataFrame to combine.
[comparer] function Optional comparer that selects the value to compare.

series.asPairs() ⇒ Pairs

Convert a series or a dataframe to a series of pairs in the form [pair1, pair2, pair3, ...] where each pair is [index, value].

Kind: instance method of Series
Returns: Pairs - Returns a series of pairs for each index and value pair in the input sequence.

series.startAt(indexValue) ⇒ Series | DataFrame

Get a new series or dataframe starting at the specified index value.

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe with all values after the specified index.

Param Type Description
indexValue value The value to search for before starting the new Series or DataFrame.

series.endAt(indexValue) ⇒ Series | DataFrame

Get a new series or dataframe ending at the specified index value (inclusive).

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe with values up to and including the specified index.

Param Type Description
indexValue value The value to search for before ending the new Series or DataFrame.

series.before(indexValue) ⇒ Series | DataFrame

Get a new series or dataframe with all values before the specified index value (exclusive).

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe with all values before the specified index.

Param Type Description
indexValue value The value to search for while taking values.

series.after(indexValue) ⇒ Series | DataFrame

Get a new series or dataframe with all values after the specified index value (exclusive).

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe with all values before the specified index.

Param Type Description
indexValue value The value to search for while taking values.

series.between(startIndexValue, endIndexValue) ⇒ Series | DataFrame

Get a new series or dataframe with all values between the specified index values (inclusive).

Kind: instance method of Series
Returns: Series | DataFrame - Returns a new series or dataframe with all values before the specified index.

Param Type Description
startIndexValue value The index where the new sequence starts.
endIndexValue value The index where the new sequence ends.

dataForge.concatDataFrames ⇒ DataFrame

Concatenate multiple dataframes into a single dataframe.

Kind: static property of dataForge
Returns: DataFrame - Returns the single concatendated dataframe.

Param Type Description
dataFrames array Array of dataframes to concatenate.

dataForge.concatSeries ⇒ Series

Concatenate multiple series into a single series.

Kind: static property of dataForge
Returns: Series - - Returns the single concatendated series.

Param Type Description
series array Array of series to concatenate.

dataForge.use(plugin) ⇒ dataForge

Install a plugin in the dataForge namespace.

Kind: static method of dataForge
Returns: dataForge - Returns the dataForge API object so that calls to 'use' can be chained.

Param Type Description
plugin plugin-object The plugin to add to data-forge.

dataForge.fromJSON(jsonTextString, [config]) ⇒ DataFrame

Deserialize a DataFrame from a JSON text string.

Kind: static method of dataForge
Returns: DataFrame - Returns a dataframe that has been deserialized from the JSON data.

Param Type Description
jsonTextString string The JSON text to deserialize.
[config] config Optional configuration option to pass to the DataFrame.

dataForge.fromCSV(csvTextString, [config]) ⇒ DataFrame

Deserialize a DataFrame from a CSV text string.

Kind: static method of dataForge
Returns: DataFrame - Returns a dataframe that has been deserialized from the CSV data.

Param Type Description
csvTextString string The CSV text to deserialize.
[config] config Optional configuration option to pass to the DataFrame.

dataForge.readFile(filePath) ⇒ object

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

Kind: static method of dataForge
Returns: object - file - Returns an object that represents the file. Use parseCSV or parseJSON to deserialize to a DataFrame.

Param Type Description
filePath string The path to the file to read.

dataForge.readFileSync(filePath) ⇒ object

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

Kind: static method of dataForge
Returns: object - Returns an object that represents the file. Use parseCSV or parseJSON to deserialize to a DataFrame.

Param Type Description
filePath string The path to the file to read.

dataForge.httpGet(url) ⇒ object

Deserialize a DataFrame from a REST API that returns data via HTTP GET. Works asynchronously, returns a promise.

Kind: static method of dataForge
Returns: object - Returns an object that represents the response REST API. Use parseCSV or parseJSON to deserialize to a DataFrame.

Param Type Description
url string URL for a REST API that returns data.

dataForge.range(start, count) ⇒ Series

Generate a series from a range of numbers.

Kind: static method of dataForge
Returns: Series - Returns a series with a sequence of generated values. The series contains 'count' values beginning at 'start'.

Param Type Description
start int The value of the first number in the range.
count int The number of sequential values in the range.

dataForge.matrix(numColumns, numRows, start, increment) ⇒ DataFrame

Generate a data-frame containing a matrix of values.

Kind: static method of dataForge
Returns: DataFrame - Returns a dataframe that contains a matrix of generated values.

Param Type Description
numColumns int The number of columns in the data-frame.
numRows int The number of rows in the data-frame.
start number The starting value.
increment number The value to increment by for each new value.

dataForge.zipSeries(series, selector) ⇒ Series

Zip together multiple series to create a new series.

Kind: static method of dataForge
Returns: Series - Returns a single series that is the combination of multiple input series that have been 'zipped' together by the 'selector' function.

Param Type Description
series array Array of series to zip together.
selector function Selector function that produces a new series based on the input series.

dataForge.zipDataFrames(dataFrames, selector) ⇒ DataFrame

Zip together multiple data-frames to create a new data-frame.

Kind: static method of dataForge
Returns: DataFrame - Returns a single dataframe that is the combination of multiple input dataframes that have been 'zipped' together by the 'selector' function.

Param Type Description
dataFrames array Array of data-frames to zip together.
selector function Selector function that produces a new data-frame based on the input data-frames.

parseCSV([config]) ⇒ Promise.<DataFrame>

Deserialize a CSV file to a DataFrame. Returns a promise that later resolves to a DataFrame.

Kind: global function
Returns: Promise.<DataFrame> - Returns a promise of a dataframe loaded from the file.

Param Type Description
[config] object Optional configuration file for parsing.

parseJSON([config]) ⇒ Promise.<DataFrame>

Deserialize a JSON file to a DataFrame. Returns a promise that later resolves to a DataFrame.

Kind: global function
Returns: Promise.<DataFrame> - Returns a promise of a dataframe loaded from the file.

Param Type Description
[config] object Optional configuration file for parsing.

parseCSV([config]) ⇒ DataFrame

Deserialize a CSV file to a DataFrame.

Kind: global function
Returns: DataFrame - Returns a dataframe that was deserialized from the file.

Param Type Description
[config] object Optional configuration file for parsing.

parseJSON([config]) ⇒ DataFrame

Deserialize a JSON file to a DataFrame.

Kind: global function
Returns: DataFrame - Returns a dataframe that was deserialized from the file.

Param Type Description
[config] object Optional configuration file for parsing.

parseCSV([config]) ⇒ Promise.<DataFrame>

Deserialize a CSV data to a DataFrame.

Kind: global function
Returns: Promise.<DataFrame> - Returns a promise of a dataframe loaded from the REST API.

Param Type Description
[config] object Optional configuration file for parsing.

parseJSON([config]) ⇒ Promise.<DataFrame>

Deserialize JSON data to a DataFrame.

Kind: global function
Returns: Promise.<DataFrame> - Returns a promise of a dataframe loaded from the REST API.

Param Type Description
[config] object Optional configuration file for parsing.

writeFile(filePath) ⇒ Promise

Serialize the dataframe to a CSV file in the local file system. Asynchronous version.

Kind: global function
Returns: Promise - Returns a promise that resolves when the file has been written.

Param Type Description
filePath string Specifies the output path for the file.

writeFileSync(filePath)

Serialize the dataframe to a CSV file in the local file system. Synchronous version.

Kind: global function

Param Type Description
filePath string Specifies the output path for the file.

httpPost(url) ⇒ Promise

Serialize the dataframe to CSV and HTTP POST it to the specified REST API.

Kind: global function
Returns: Promise - Returns a promise that resolves when the HTTP request has completed.

Param Type Description
url string The URL of the REST API.

writeFile(filePath) ⇒ Promise

Serialize the dataframe to a JSON file in the local file system. Asynchronous version.

Kind: global function
Returns: Promise - Returns a promise that resolves when the file has been written.

Param Type Description
filePath string Specifies the output path for the file.

writeFileSync(filePath)

Serialize the dataframe to a JSON file in the local file system. Synchronous version.

Kind: global function

Param Type Description
filePath string Specifies the output path for the file.

httpPost(url) ⇒ Promise

Serialize the dataframe to JSON and HTTP POST it to the specified REST API.

Kind: global function
Returns: Promise - Returns a promise that resolves when the HTTP request has completed.

Param Type Description
url string The URL of the REST API.