Get an iterator to enumerate the rows of the dataframe.
Enumerating the iterator forces lazy evaluation to complete.
This function is automatically called by for...of
.
An iterator for the rows in the dataframe.
Gets a new dataframe containing all rows after the specified index value (exclusive).
The index value after which to start the new dataframe.
Returns a new dataframe containing all rows after the specified index value.
Aggregate the rows in the dataframe to a single result.
aggregate
is similar to DataFrame.reduce but the parameters are reversed.
Please use DataFrame.reduce in preference to aggregate
.
Function that takes the seed and then each row in the dataframe and produces the aggregate value.
Returns a new value that has been aggregated from the dataframe using the 'selector' function.
Evaluates a predicate function for every row in the dataframe to determine if some condition is true/truthy for all rows in the dataframe.
Predicate function that receives each row. It should returns true/truthy for a match, otherwise false/falsy.
Returns true if the predicate has returned true or truthy for every row in the dataframe, otherwise returns false. Returns false for an empty dataframe.
Evaluates a predicate function for every row in the dataframe to determine if some condition is true/truthy for any of rows in the dataframe.
If no predicate is specified then it simply checks if the dataframe contains more than zero rows.
Optional predicate function that receives each row. It should return true/truthy for a match, otherwise false/falsy.
Returns true if the predicate has returned truthy for any row in the sequence, otherwise returns false. If no predicate is passed it returns true if the dataframe contains any rows at all. Returns false for an empty dataframe.
Append a pair to the end of a dataframe. Doesn't modify the original dataframe! The returned dataframe is entirely new and contains rows from the original dataframe plus the appended pair.
The index/value pair to append.
Returns a new dataframe with the specified pair appended.
Get the row, if there is one, with the specified index.
Index to for which to retreive the row.
Returns the row from the specified index in the dataframe or undefined if there is no such index in the present in the dataframe.
Forces lazy evaluation to complete and 'bakes' the dataframe into memory.
Returns a dataframe that has been 'baked', all lazy evaluation has completed.
Gets a new dataframe containing all rows up to the specified index value (exclusive).
The index value at which to end the new dataframe.
Returns a new dataframe containing all rows up to (but not including) the specified index value.
Gets a new dataframe containing all rows between the specified index values (inclusive).
The index at which to start the new dataframe.
The index at which to end the new dataframe.
Returns a new dataframe containing all values between the specified index values (inclusive).
Bring the column(s) with specified name(s) to the back of the column order, making it (or them) the last column(s) in the output dataframe.
Specifies the column or columns to bring to the back.
Returns a new dataframe with 1 or more columns bought to the back of the column ordering.
Bring the column(s) with specified name(s) to the front of the column order, making it (or them) the first column(s) in the output dataframe.
Specifies the column or columns to bring to the front.
Returns a new dataframe with 1 or more columns bought to the front of the column ordering.
Cast the value of the dataframe to a new type. This operation has no effect but to retype the r9ws that the dataframe contains.
The same dataframe, but with the type changed.
Concatenate multiple other dataframes onto this dataframe.
Multiple arguments. Each can be either a dataframe or an array of dataframes.
Returns a single dataframe concatenated from multiple input dataframes.
Count the number of rows in the dataframe
Returns the count of all rows.
Returns the specified default dataframe if the input dataframe is empty.
Default dataframe to return if the input dataframe is empty.
Returns 'defaultSequence' if the input dataframe is empty.
Converts (deflates) a dataframe to a Series.
Optional user-defined selector function that transforms each row to produce the series.
Returns a series that was created from the original dataframe.
Detect the the frequency of the types of the values in the dataframe. This is a good way to understand the shape of your data.
Returns a dataframe with rows that confirm to ITypeFrequency that describes the data types contained in the original dataframe.
Detect the frequency of the values in the dataframe. This is a good way to understand the shape of your data.
Returns a dataframe with rows that conform to IValueFrequency that describes the values contained in the original dataframe.
Returns only the set of rows in the dataframe that are distinct according to some criteria. This can be used to remove duplicate rows from the dataframe.
User-defined selector function that specifies the criteria used to make comparisons for duplicate rows. Note that the selector determines the object used for the comparison. If the selector returns a new instance of an array or a javascript object, distinct will always include all rows since the object instances are different even if the members are the same.
Returns a dataframe containing only unique values as determined by the 'selector' function.
Create a new dataframe with the requested column or columns dropped.
Specifies the column name (a string) or columns (array of strings) to drop.
Returns a new dataframe with a particular named column or columns removed.
Gets a new dataframe containing all rows up until and including the specified index value (inclusive).
The index value at which to end the new dataframe.
Returns a new dataframe containing all rows up until and including the specified index value.
Add a series to the dataframe, but only if it doesn't already exist.
The name of the series to add or a IColumnGenSpec that specifies the columns to add.
If columnNameOrSpec is a string that specifies the name of the series to add, this specifies the actual Series to add or a selector that generates the series given the 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.
Creates a new dataframe by merging two input dataframes. The resulting dataframe contains only the rows from the 1st dataframe that don't appear in the 2nd dataframe. This is essentially subtracting the rows from the 2nd dataframe from the 1st and creating a new dataframe with the remaining rows.
The inner dataframe to merge (the dataframe you call the function on is the 'outer' dataframe).
Optional user-defined selector function that selects the key from the outer dataframe that is used to match the two dataframes.
Optional user-defined selector function that selects the key from the inner dataframe that is used to match the two dataframes.
Returns a new dataframe that contains only the rows from the 1st dataframe that don't appear in the 2nd dataframe.
Verify the existence of a name column and extracts the Series for it. Throws an exception if the requested column doesn't exist.
Name of the column to extract.
Returns the Series for the column if it exists, otherwise it throws an exception.
Fill gaps in a dataframe.
User-defined comparer function 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.
User-defined generator function that is passed pairA and pairB, two consecutive rows, returns an array of pairs that fills the gap between the rows.
Returns a new dataframe with gaps filled in.
Filter the dataframe through a user-defined predicate function.
This is the same concept as the JavaScript function Array.filter
but filters a dataframe rather than an array.
Predicate function to filter values from the dataframe. Returns true/truthy to keep elements, or false/falsy to omit elements.
Returns a new dataframe containing only the values from the original dataframe that matched the predicate.
Get the first row of the dataframe.
Returns the first row of the dataframe.
Transforms and flattens an input dataframe, generating a new dataframe. The transformer function is called for each value in the input dataframe and produces an array that is then flattened into the generated dataframe.
This is the same concept as the JavaScript function Array.flatMap
but maps over a dataframe rather than an array.
A user-defined function that transforms each value into an array that is then flattened into the generated dataframe.
Returns a new dataframe generated by calling the transformer function over each element of the input.
Invoke a callback function for each row in the dataframe.
The calback function to invoke for each row.
Returns the original dataframe with no modifications.
Generate new columns based on existing rows.
This is equivalent to calling select to transform the original dataframe to a new dataframe with different column, then using withSeries to merge each the of both the new and original dataframes.
Generator function that transforms each row to produce 1 or more new columns. Or use a column spec that has fields for each column, the fields specify a generate function that produces the value for each new column.
Returns a new dataframe with 1 or more new columns.
Get the names of the columns in the dataframe.
Returns an array of the column names in the dataframe.
Collects rows in the dataframe into a Series of groups according to a user-defined selector function.
User-defined selector function that specifies the criteria to group by.
Returns a Series of groups. Each group is a dataframe with rows that have been grouped by the 'selector' function.
Collects values in the series into a new series of groups based on if the values are the same or according to a user-defined selector function.
Optional selector that specifies the criteria for grouping.
Returns a Series of groups. Each group is a dataframe with rows that are the same or have been grouped by the 'selector' function.
Get X rows from the start of the dataframe. Pass in a negative value to get all rows at the head except for X rows at the tail.
Number of rows to take.
Returns a new dataframe that has only the specified number of rows taken from the start of the original dataframe.
Inflate a named Series in the dataframe to 1 or more new series in the new dataframe.
This is the equivalent of extracting the series using getSeries, transforming them with Series.select and then running Series.inflate to create a new dataframe, then merging each column of the new dataframe into the original dataframe using withSeries.
Name of the series to inflate.
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.
Returns a new dataframe with a column inflated to 1 or more new columns.
Insert a pair at the start of the dataframe. Doesn't modify the original dataframe! The returned dataframe is entirely new and contains rows from the original dataframe plus the inserted pair.
The index/value pair to insert.
Returns a new dataframe with the specified pair inserted.
Creates a new dataframe by merging two input dataframes. The resulting dataframe contains the intersection of rows from the two input dataframes. These are only the rows that appear in both dataframes.
The inner dataframe to merge (the dataframe you call the function on is the 'outer' dataframe).
Optional user-defined selector function that selects the key from the outer dataframe that is used to match the two dataframes.
Optional user-defined selector function that selects the key from the inner dataframe that is used to match the two dataframes.
Returns a new dataframe that contains the intersection of rows from the two input dataframes.
Creates a new dataframe by merging two input dataframes. The resulting dataframe contains only those rows that have matching keys in both input dataframes.
The 'inner' dataframe to join (the dataframe you are callling the function on is the 'outer' dataframe).
User-defined selector function that chooses the join key from the outer dataframe.
User-defined selector function that chooses the join key from the inner dataframe.
User-defined function that merges outer and inner values.
Returns the new merged dataframe.
Creates a new dataframe by merging two input dataframes. The resulting dataframe contains only those rows that are only present in one or the other of the dataframes, or both.
The 'inner' dataframe to join (the dataframe you are callling the function on is the 'outer' dataframe).
User-defined selector function that chooses the join key from the outer dataframe.
User-defined selector function that chooses the join key from the inner dataframe.
User-defined function that merges outer and inner values.
Implementation from here:
http://blogs.geniuscode.net/RyanDHatch/?p=116
Returns the new merged dataframe.
Creates a new dataframe by merging two input dataframes. The resulting dataframe contains only those rows that are present either in both dataframes or only in the outer (left) dataframe.
The 'inner' dataframe to join (the dataframe you are callling the function on is the 'outer' dataframe).
User-defined selector function that chooses the join key from the outer dataframe.
User-defined selector function that chooses the join key from the inner dataframe.
User-defined function that merges outer and inner values.
Implementation from here:
http://blogs.geniuscode.net/RyanDHatch/?p=116
Returns the new merged dataframe.
Creates a new dataframe by merging two input dataframes. The resulting dataframe contains only those rows that are present either in both dataframes or only in the inner (right) dataframe.
The 'inner' dataframe to join (the dataframe you are callling the function on is the 'outer' dataframe).
User-defined selector function that chooses the join key from the outer dataframe.
User-defined selector function that chooses the join key from the inner dataframe.
User-defined function that merges outer and inner values.
Implementation from here:
http://blogs.geniuscode.net/RyanDHatch/?p=116
Returns the new merged dataframe.
Get the last row of the dataframe.
Returns the last row of the dataframe.
Transforms an input dataframe, generating a new dataframe. The transformer function is called for each element of the input and the collection of outputs creates the generated datafarme.
This is the same concept as the JavaScript function Array.map
but maps over a dataframe rather than an array.
A user-defined transformer function that transforms each element from the input to generate the output.
Returns a new dataframe generated by calling the transformer function over each element of the input.
Unpivot a DataFrame from wide to long format, optionally leaving identifiers set. This is a powerful function that combines grouping, aggregation and sorting.
Column(s) to use as identifier variables.
Column(s) to unpivot.
Returns a new dataframe that has been unpivoted based on a particular column's values.
Merge one or more dataframes into this single dataframe. Rows are merged by indexed. Same named columns in subsequent dataframes override columns in earlier dataframes.
The merged data frame.
Evaluates a predicate function for every row in the dataframe to determine if some condition is true/truthy for none of rows in the dataframe.
If no predicate is specified then it simply checks if the dataframe contains zero rows.
Optional predicate function that receives each row. It should return true/truthy for a match, otherwise false/falsy.
Returns true if the predicate has returned truthy for zero rows in the dataframe, otherwise returns false. Returns false for an empty dataframe.
Sorts the dataframe in ascending order by a value defined by the user-defined selector function.
User-defined selector function that selects the value to sort by.
Returns a new dataframe that has been ordered accorrding to the value chosen by the selector function.
Sorts the dataframe in descending order by a value defined by the user-defined selector function.
User-defined selector function that selects the value to sort by.
Returns a new dataframe that has been ordered accorrding to the value chosen by the selector function.
Parse a column with string values and convert it to a column with date values.
-Specifies the column name or array of column names to parse.
Optional formatting string for dates.
Returns a new dataframe with a particular named column parsed as dates.
Parse a column with string values and convert it to a column with float values.
Specifies the column name or array of column names to parse.
Returns a new dataframe with a particular named column parsed as floats.
Parse a column with string values and convert it to a column with int values.
Specifies the column name or array of column names to parse.
Returns a new dataframe with a particular named column parsed as ints.
Reshape (or pivot) a dataframe based on column values. This is a powerful function that combines grouping, aggregation and sorting.
Column name whose values make the new DataFrame's columns.
Column name or column spec that defines the columns whose values should be aggregated.
Optional function used to aggregate pivotted vales.
Returns a new dataframe that has been pivoted based on a particular column's values.
Reduces the values in the dataframe to a single result.
This is the same concept as the JavaScript function Array.reduce
but reduces a dataframe rather than an array.
Function that takes the seed and then each value in the dataframe and produces the reduced value.
Optional initial value, if not specifed the first value in the dataframe is used as the initial value.
Returns a value that has been reduced from the input dataframe by passing each element through the reducer function.
Create a new dataframe with 1 or more columns renamed.
A column rename spec - a JavaScript hash that maps existing column names to new column names.
Returns a new dataframe with specified columns renamed.
Create a new dataframe with columns reordered. New column names create new columns (with undefined values), omitting existing column names causes those columns to be dropped.
Specifies the new order for columns.
Returns a new dataframe with columns reordered according to the order of the array of column names that is passed in.
Resets the Index of the dataframe back to the default zero-based sequential integer index.
Returns a new dataframe with the Index reset to the default zero-based index.
Gets a new dataframe in reverse order.
Returns a new dataframe that is the reverse of the original.
Partition a dataframe into a Series of rolling data windows. Each value in the new series is a rolling chunk of data from the original dataframe.
The number of data rows to include in each data window.
Returns a new series, each value of which is a rolling chunk of the original dataframe.
Produces a new dataframe with all number values rounded to the specified number of places.
The number of decimal places, defaults to 2.
Returns a new dataframe with all number values rounded to the specified number of places.
Transforms an input dataframe, generating a new dataframe. The transformer function is called for each element of the input and the collection of outputs creates the generated datafarme.
select
is an alias for DataFrame.map.
This is the same concept as the JavaScript function Array.map
but maps over a dataframe rather than an array.
A user-defined transformer function that transforms each element from the input to generate the output.
Returns a new dataframe generated by calling the transformer function over each element of the input.
Transforms and flattens an input dataframe, generating a new dataframe. The transformer function is called for each value in the input dataframe and produces an array that is then flattened into the generated dataframe.
selectMany
is an alias for DataFrame.flatMap.
This is the same concept as the JavaScript function Array.flatMap
but maps over a dataframe rather than an array.
A user-defined function that transforms each value into an array that is then flattened into the generated dataframe.
Returns a new dataframe generated by calling the transformer function over each element of the input.
Eliminates adjacent duplicate rows.
For each group of adjacent values that are equivalent only returns the last index/row for the group, thus adjacent equivalent rows are collapsed down to the last row.
Optional selector function to determine the value used to compare for equivalence.
Returns a new dataframe with groups of adjacent duplicate rows collapsed to a single row per group.
Serialize the dataframe to an ordinary JavaScript data structure. The resulting data structure is suitable for further serialization to JSON and can be used to transmit a DataFrame and its internal structure over the wire. Use the deserialize function to later reconstitute the serialized dataframe.
Returns a JavaScript data structure conforming to {@link ISerializedDataFrame} that represents the dataframe and its internal structure.
Set a named column as the Index of the dataframe.
Name of the column to use as the new Index of the returned dataframe.
Returns a new dataframe with the values of the specified column as the new Index.
Skip a number of rows in the dataframe.
Number of rows to skip.
Returns a new dataframe with the specified number of rows skipped.
Skips values in the dataframe untils a condition evaluates to true or truthy.
Return true/truthy to stop skipping rows in the original dataframe.
Returns a new dataframe with all initial sequential rows removed until the predicate returned true/truthy.
Skips values in the dataframe while a condition evaluates to true or truthy.
Returns true/truthy to continue to skip rows in the original dataframe.
Returns a new dataframe with all initial sequential rows removed while the predicate returned true/truthy.
Gets a new dataframe containing all rows starting at and after the specified index value.
The index value at which to start the new dataframe.
Returns a new dataframe containing all rows starting at and after the specified index value.
Create a new dataframe with just a subset of columns.
Array of column names to include in the new dataframe.
Returns a dataframe with a subset of columns from the original dataframe.
Produces a summary of dataframe.
Optional parameter that specifies which columns to aggregate and how to aggregate them. Leave this out to produce a default summary of all columns.
A object with fields that summary the values in the dataframe.
Get X rows from the end of the dataframe. Pass in a negative value to get all rows at the tail except X rows at the head.
Number of rows to take.
Returns a new dataframe that has only the specified number of rows taken from the end of the original dataframe.
Take a number of rows in the dataframe.
Returns a new dataframe with only the specified number of rows taken from the original dataframe.
Takes values from the dataframe untils a condition evaluates to true or truthy.
Return true/truthy to stop taking rows in the original dataframe.
Returns a new dataframe with only the initial sequential rows taken until the predicate returned true/truthy.
Takes values from the dataframe while a condition evaluates to true or truthy.
Returns true/truthy to continue to take rows from the original dataframe.
Returns a new dataframe with only the initial sequential rows that were taken while the predicate returned true/truthy.
Applys additional sorting (ascending) to an already sorted dataframe.
User-defined selector that selects the additional value to sort by.
Returns a new dataframe has been additionally sorted by the value chosen by the selector function.
Applys additional sorting (descending) to an already sorted dataframe.
User-defined selector that selects the additional value to sort by.
Returns a new dataframe has been additionally sorted by the value chosen by the selector function.
Extract rows from the dataframe as an array. Each element of the array is one row of the dataframe represented as a JavaScript object with the fields as the dataframe's columns. This forces lazy evaluation to complete.
Returns an array of the rows contained within the dataframe.
Serialize the dataframe to the CSV data format.
Options for CSV output. The options object is passed directly to PapaParse.unparse, please see PapaParse docs for additional options.
Returns a string in the CSV data format that represents the dataframe.
Serialize the dataframe to HTML.
Returns a string in HTML format that represents the dataframe.
Serialize the dataframe to the JSON data format.
Returns a string in the JSON data format that represents the dataframe.
Serialize the dataframe to the JSON5 data format.
Returns a string in the JSON5 data format that represents the dataframe.
Convert the dataframe to a JavaScript object.
User-defined selector function that selects keys for the resulting object.
User-defined selector function that selects values for the resulting object.
Returns a JavaScript object generated from the dataframe by applying the key and value selector functions.
Retreive the index, row pairs from the dataframe as an array. Each pair is [index, row]. This forces lazy evaluation to complete.
Returns an array of pairs that contains the dataframe's rows. Each pair is a two element array that contains an index and a row.
Bake the data frame to an array of rows were each rows is an array of values in column order.
Returns an array of rows. Each row is an array of values in column order.
Format the dataframe for display as a string. This forces lazy evaluation to complete.
Generates and returns a string representation of the dataframe or dataframe.
Convert a column of values of different types to a column of string values.
Specifies the column name or array of column names to convert to strings. Can also be a format spec that specifies which columns to convert and what their format should be.
Optional formatting string for dates.
Numeral.js is used for number formatting. http://numeraljs.com/
Moment is used for date formatting. https://momentjs.com/docs/#/parsing/string-format/
Returns a new dataframe with a particular named column convert to strings.
Transform one or more columns.
This is equivalent to extracting a Series with getSeries, then transforming it with Series.select, and finally plugging it back in as the same column using withSeries.
Object with field names for each column to be transformed. Each field specifies a selector function that transforms that column.
Returns a new dataframe with 1 or more columns transformed.
Produces a new dataframe with all string values truncated to the requested maximum length.
The maximum length of the string values after truncation.
Returns a new dataframe with all strings truncated to the specified maximum length.
Creates a new dataframe by merging two input dataframes. The resulting dataframe contains the union of rows from the two input dataframes. These are the unique combination of rows in both dataframe. This is basically a concatenation and then elimination of duplicates.
The other dataframes to merge.
Optional user-defined selector function that selects the value to compare to determine distinctness.
Returns the union of the two dataframes.
Partition a dataframe into a Series of variable-length data windows where the divisions between the data chunks are defined by a user-provided comparer function.
Function that compares two adjacent data rows and returns true if they should be in the same window.
Returns a new series, each value of which is a chunk of data from the original dataframe.
Filter the dataframe through a user-defined predicate function.
where
is an alias for DataFrame.filter.
This is the same concept as the JavaScript function Array.filter
but filters a dataframe rather than an array.
Predicate function to filter values from the dataframe. Returns true/truthy to keep elements, or false/falsy to omit elements.
Returns a new dataframe containing only the values from the original dataframe that matched the predicate.
Partition a dataframe into a Series of data windows. Each value in the new series is a chunk of data from the original dataframe.
The number of rows to include in each data window.
Returns a new series, each value of which is a chunk (data window) of the original dataframe.
Apply a new Index to the dataframe.
Returns a new dataframe with the specified Index attached.
Create a new dataframe with a replaced or additional column specified by the passed-in series.
The name of the column to add or replace or a IColumnGenSpec that defines the columns to add.
When columnNameOrSpec is a string that identifies the column to add, this specifies the Series to add to the dataframe or a function that produces a series (given a dataframe).
Returns a new dataframe replacing or adding a particular named column.
Merge together multiple dataframes to create a new dataframe. Preserves the index of the first dataframe.
User-defined zipper function that merges rows. It produces rows for the new dataframe based-on rows from the input dataframes.
Returns a single dataframe merged from multiple input dataframes.
Generated using TypeDoc
Interface to a dataframe that has been sorted.