###

``
Need help reading this?

### DataFrame

src/dataframe.js

DataFrame data structure providing an immutable, flexible and powerfull way to manipulate data with columns and rows.

new DataFrame()
Static Members
▸ setDefaultModules(defaultModules)

Set the default modules used in DataFrame instances.

setDefaultModules(defaultModules: ...Object)
Parameters
defaultModules `(...Object)` DataFrame modules used by default.
Example

    DataFrame.setDefaultModules(SQL, Stat)

▸ fromText(pathOrFile, [sep], [header])

Create a DataFrame from a Text file. It returns a Promise.

fromText(pathOrFile: (String | File), sep: [String](default ';'), header: [Boolean])
Parameters
pathOrFile `((String | File))` A path to the file (url or local) or a browser File object.
sep `([String](default ';'))` The separator used to parse the file.
header `([Boolean] (default `true`) )` A boolean indicating if the text has a header or not.
Example

    DataFrame.fromText('http://myurl/myfile.txt').then(df => df.show())
    // In browser Only
    DataFrame.fromText(myFile).then(df => df.show())
    // From node.js only Only
    DataFrame.fromText('/my/absolue/path/myfile.txt').then(df => df.show())
    DataFrame.fromText('/my/absolue/path/myfile.txt', ';', true).then(df => df.show())

▸ fromCSV(pathOrFile, [header])

Create a DataFrame from a CSV file. It returns a Promise.

fromCSV(pathOrFile: (String | File), header: [Boolean])
Parameters
pathOrFile `((String | File))` A path to the file (url or local) or a browser File object.
header `([Boolean] (default `true`) )` A boolean indicating if the csv has a header or not.
Example

    DataFrame.fromCSV('http://myurl/myfile.csv').then(df => df.show())
    // For browser only
    DataFrame.fromCSV(myFile).then(df => df.show())
    // From node.js only
    DataFrame.fromCSV('/my/absolue/path/myfile.csv').then(df => df.show())
    DataFrame.fromCSV('/my/absolue/path/myfile.csv', true).then(df => df.show())

▸ fromJSON(pathOrFile)

Create a DataFrame from a JSON file. It returns a Promise.

fromJSON(pathOrFile: (String | File))
Parameters
pathOrFile `((String | File))` A path to the file (url or local) or a browser File object.
Example

    DataFrame.fromJSON('http://myurl/myfile.json').then(df => df.show())
    // For browser only
    DataFrame.fromJSON(myFile).then(df => df.show())
    // From node.js only
    DataFrame.fromJSON('/my/absolute/path/myfile.json').then(df => df.show())

Instance Members
▸ constructor(data, columns, [modules])

Create a new DataFrame.

constructor(data: (Array | Object | DataFrame), columns: Array, modules: [...Object])
Parameters
data `((Array | Object | DataFrame))` The data of the DataFrame.
columns `(Array)` The DataFrame column names.
modules `([...Object])` Additional modules.
Example

    new DataFrame({
         'column1': [3, 6, 8],
         'column2': [3, 4, 5, 6],
    }, ['column1', 'column2'])

    new Data Frame([
         [1, 6, 9, 10, 12],
         [1, 2],
         [6, 6, 9, 8, 9, 12],
    ], ['c1', 'c2', 'c3', 'c4', 'c5', 'c6'])

    new DataFrame([
         {c1: 1, c2: 6, c3: 9, c4: 10, c5: 12},
         {c4: 1, c3: 2},
         {c1: 6, c5: 6, c2: 9, c4: 8, c3: 9, c6: 12},
    ], ['c1', 'c2', 'c3', 'c4', 'c5', 'c6'])

    new DataFrame(df);

▸ toDict()

Convert DataFrame into dict / hash / object.

toDict(): Object
Returns
`Object`: The DataFrame converted into dict.
Example

    df.toDict()

▸ toArray([columnName])

Convert DataFrame into Array of Arrays. You can also extract only one column as Array.

toArray(columnName: [String]): Array
Parameters
columnName `([String])` Column Name to extract. By default, all columns are transformed.
Returns
`Array`: The DataFrame (or the column) converted into Array.
Example

    df.toArray()

▸ toCollection([ofRows])

Convert DataFrame into Array of dictionnaries. You can also return Rows instead of dictionnaries.

toCollection(ofRows: [Boolean]): Array
Parameters
ofRows `([Boolean])` Return a collection of Rows instead of dictionnaries.
Returns
`Array`: The DataFrame converted into Array of dictionnaries (or Rows).
Example

    df.toCollection()

▸ toText([sep], [header], [path])

Convert the DataFrame into a text string. You can also save the file if you are using nodejs.

toText(sep: [String], header: [Boolean], path: [String]): String
Parameters
sep `([String] (default `' '`) )` Column separator.
header `([Boolean] (default `true`) )` Writing the header in the first line. If false, there will be no header.
path `([String])` The path to save the file. /!\ Works only on node.js, not into the browser.
Returns
`String`: The text file in raw string.
Example

    df.toText()
    df.toText(';')
    df.toText(';', true)
    // From node.js only
    df.toText(';', true, '/my/absolute/path/dataframe.txt')

▸ toCSV([header], [path])

Convert the DataFrame into a csv string. You can also save the file if you are using nodejs.

toCSV(header: [Boolean], path: [String]): String
Parameters
header `([Boolean] (default `true`) )` Writing the header in the first line. If false, there will be no header.
path `([String])` The path to save the file. /!\ Works only on node.js, not into the browser.
Returns
`String`: The csv file in raw string.
Example

    df.toCSV()
    df.toCSV(true)
    // From node.js only
    df.toCSV(true, '/my/absolute/path/dataframe.csv')

▸ toJSON([asCollection], [path])

Convert the DataFrame into a json string. You can also save the file if you are using nodejs.

toJSON(asCollection: [Boolean], path: [String]): String
Parameters
asCollection `([Boolean] (default `true`) )` Writing the JSON as collection of Object.
path `([String])` The path to save the file. /!\ Works only on node.js, not into the browser.
Returns
`String`: The json file in raw string.
Example

    df.toJSON()
    // From node.js only
    df.toJSON('/my/absolute/path/dataframe.json')

▸ show([rows], [quiet])

Display the DataFrame as String Table. Can only return a sring instead of displaying the DataFrame.

show(rows: [Number], quiet: [Boolean]): String
Parameters
rows `([Number] (default `10`) )` The number of lines to display.
quiet `([Boolean] (default `false`) )` Quiet mode. If true, only returns a string instead of console.log().
Returns
`String`: The DataFrame as String Table.
Example

    df.show()
    df.show(10)
    const stringDF = df.show(10, true)

▸ dim()

Get the DataFrame dimensions.

dim(): Array
Returns
`Array`: The DataFrame dimensions. [height, weight]
Example

    const [height, weight] = df.dim()

▸ transpose([transposeColumnNames], tranposeColumnNames)

Transpose a DataFrame. Rows become columns and conversely. n x p => p x n.

transpose(transposeColumnNames: [Boolean], tranposeColumnNames: any): ÐataFrame
Parameters
transposeColumnNames `([Boolean] (default `false`) )` An option to transpose columnNames in a rowNames column.
tranposeColumnNames `(any)`
Returns
`ÐataFrame`: A new transposed DataFrame.
Example

    df.transpose()

▸ count()

Get the rows number.

count(): Int
Returns
`Int`: The number of DataFrame rows.
Example

    df.count()

▸ countValue(valueToCount, [columnName])

Get the count of a value into a column.

countValue(valueToCount: any, columnName: [String]): Int
Parameters
valueToCount `(any)` The value to count into the selected column.
columnName `([String] (default `this.listColumns()[0]`) )` The column to count the value.
Returns
`Int`: The number of times the selected value appears.
Example

    df.countValue(5, 'column2')
    df.select('column1').countValue(5)

▸ push(rows)

Push new rows into the DataFrame.

push(rows: (Array | Row)): DataFrame
Parameters
rows `((Array | Row))` The rows to add.
Returns
`DataFrame`: A new DataFrame with the new rows.
Example

    df.push([1,2,3], [1,4,9])

▸ replace(value, replacement, [columnNames])

Replace a value by another in all the DataFrame or in a column.

replace(value: any, replacement: any, columnNames: [(String | Array)]): DataFrame
Parameters
value `(any)` The value to replace.
replacement `(any)` The new value.
columnNames `([(String | Array)] (default `this.listColumns()`) )` The columns to apply the replacement.
Returns
`DataFrame`: A new DataFrame with replaced values.
Example

    df.replace(undefined, 0, 'column1', 'column2')

▸ distinct(columnName)

Compute unique values into a column.

distinct(columnName: String): DataFrame
Parameters
columnName `(String)` The column to distinct.
Returns
`DataFrame`: A DataFrame containing the column with distinct values.
Example

    df.distinct('column1')

▸ unique(columnName)

Compute unique values into a column. Alias from .distinct()

unique(columnName: String): DataFrame
Parameters
columnName `(String)` The column to distinct.
Returns
`DataFrame`: A DataFrame containing the column with distinct values.
Example

    df.unique('column1')

▸ listColumns()

List DataFrame columns.

listColumns(): Array
Returns
`Array`: An Array containing DataFrame columnNames.
Example

    df.listColumns()

▸ select(columnNames)

Select columns in the DataFrame.

select(columnNames: ...String): DataFrame
Parameters
columnNames `(...String)` The columns to select.
Returns
`DataFrame`: A new DataFrame containing selected columns.
Example

    df.select('column1', 'column3')

▸ withColumn(columnName, [func])

Add a new column or set an existing one.

withColumn(columnName: String, func: [Function]): DataFrame
Parameters
columnName `(String)` The column to modify or to create.
func `([Function] (default `(row,index)`) )` The function to create the column.
Returns
`DataFrame`: A new DataFrame containing the new or modified column.
Example

    df.withColumn('column4', () => 2)
    df.withColumn('column2', (row) => row.get('column2') * 2)

▸ restructure(newColumnNames)

Modify the structure of the DataFrame by changing columns order, creating new columns or removing some columns.

restructure(newColumnNames: Array): DataFrame
Parameters
newColumnNames `(Array)` The new columns of the DataFrame.
Returns
`DataFrame`: A new DataFrame with restructured columns (renamed, add or deleted).
Example

    df.restructure(['column1', 'column4', 'column2', 'column3'])
    df.restructure(['column1', 'column4'])
    df.restructure(['column1', 'newColumn', 'column4'])

▸ renameAll(newColumnNames)

Rename each column.

renameAll(newColumnNames: Array): DataFrame
Parameters
newColumnNames `(Array)` The new column names of the DataFrame.
Returns
`DataFrame`: A new DataFrame with the new column names.
Example

    df.renameAll(['column1', 'column3', 'column4'])

▸ rename(columnName, replacement)

Rename a column.

rename(columnName: String, replacement: String): DataFrame
Parameters
columnName `(String)` The column to rename.
replacement `(String)` The new name for the column.
Returns
`DataFrame`: A new DataFrame with the new column name.
Example

    df.rename('column1', 'columnRenamed')

▸ castAll(typeFunctions)

Cast each column into a given type.

castAll(typeFunctions: Array): DataFrame
Parameters
typeFunctions `(Array)` The functions used to cast columns.
Returns
`DataFrame`: A new DataFrame with the columns having new types.
Example

    df.castAll([Number, String, (val) => new CustomClass(val)])

▸ cast(columnName, ObjectType, typeFunction)

Cast a column into a given type.

cast(columnName: String, ObjectType: Function, typeFunction: any): DataFrame
Parameters
columnName `(String)` The column to cast.
ObjectType `(Function)` The function used to cast the column.
typeFunction `(any)`
Returns
`DataFrame`: A new DataFrame with the column having a new type.
Example

    df.cast('column1', Number)
    df.cast('column1', (val) => new MyCustomClass(val))

▸ drop(columnName)

Remove a single column.

drop(columnName: String): DataFrame
Parameters
columnName `(String)` The column to drop.
Returns
`DataFrame`: A new DataFrame without the dropped column.
Example

    df.drop('column2')

▸ chain(funcs)

Chain maps and filters functions on DataFrame by optimizing their executions. If a function returns boolean, it's a filter. Else it's a map. It can be 10 - 100 x faster than standard chains of .map() and .filter().

chain(funcs: ...Function): DataFrame
Parameters
funcs `(...Function)` Functions to apply on the DataFrame rows taking the row as parameter.
Returns
`DataFrame`: A new DataFrame with modified rows.
Example

    df.chain(
         row => row.get('column1') > 3, // filter
         row => row.set('column1', 3),  // map
         row => row.get('column2') === '5' // filter
    )

▸ filter(condition)

Filter DataFrame rows.

filter(condition: (Function | Object)): DataFrame
Parameters
condition `((Function | Object))` A filter function or a column/value object.
Returns
`DataFrame`: A new filtered DataFrame.
Example

    df.filter(row => row.get('column1') >= 3)
    df.filter({'column2': 5, 'column1': 3}))

▸ where(condition)

Filter DataFrame rows. Alias of .filter()

where(condition: (Function | Object)): DataFrame
Parameters
condition `((Function | Object))` A filter function or a column/value object.
Returns
`DataFrame`: A new filtered DataFrame.
Example

    df.where(row => row.get('column1') >= 3)
    df.where({'column2': 5, 'column1': 3}))

▸ find(condition)

Find a row (the first met) based on a condition.

find(condition: (Function | Object)): Row
Parameters
condition `((Function | Object))` A filter function or a column/value object.
Returns
`Row`: The targeted Row.
Example

    df.find(row => row.get('column1') === 3)
    df.find({'column1': 3})

▸ map(func)

Map on DataFrame rows. /!\ Prefer to use .chain().

map(func: Function): DataFrame
Parameters
func `(Function)` A function to apply on each row taking the row as parameter.
Returns
`DataFrame`: A new DataFrame with modified rows.
Example

    df.map(row => row.set('column1', row.get('column1') * 2))

▸ reduce(func, init)

Reduce DataFrame into a value.

reduce(func: Function, init: any): any
Parameters
func `(Function)` The reduce function taking 2 parameters, previous and next.
init `(any)` The initial value of the reducer.
Returns
`any`: A reduced value.
Example

    df.reduce((p, n) => n.get('column1') + p, 0)
    df2.reduce((p, n) => (
             n.set('column1', p.get('column1') + n.get('column1'))
              .set('column2', p.get('column2') + n.get('column2'))
    ))

▸ reduceRight(func, init)

Reduce DataFrame into a value, starting from the last row (see .reduce()).

reduceRight(func: Function, init: any): any
Parameters
func `(Function)` The reduce function taking 2 parameters, previous and next.
init `(any)` The initial value of the reducer.
Returns
`any`: A reduced value.
Example

    df.reduceRight((p, n) => p > n ? p : n, 0)

▸ dropDuplicates()

Return a DataFrame without duplicated columns.

dropDuplicates(): DataFrame
Returns
`DataFrame`: A DataFrame without duplicated rows.
Example

    df.dropDuplicates()

▸ shuffle()

Return a shuffled DataFrame rows.

shuffle(): DataFrame
Returns
`DataFrame`: A shuffled DataFrame.
Example

    df.shuffle()

▸ sample(percentage)

Return a random sample of rows.

sample(percentage: Number): DataFrame
Parameters
percentage `(Number)` A percentage of the orignal DataFrame giving the sample size.
Returns
`DataFrame`: A sample DataFrame
Example

    df.sample(0.3)

▸ bisect(percentage)

Randomly split a DataFrame into 2 DataFrames.

bisect(percentage: Number): Array
Parameters
percentage `(Number)` A percentage of the orignal DataFrame giving the first DataFrame size. The second takes the rest.
Returns
`Array`: An Array containing the two DataFrames. First, the X% DataFrame then the rest DataFrame.
Example

    const [30DF, 70DF] = df.bisect(0.3)

▸ groupBy(columnNames)

Group DataFrame rows by columns giving a GroupedDataFrame object. See its doc for more examples.

groupBy(columnNames: ...String): GroupedDataFrame
Parameters
columnNames `(...String)` The columns used for the groupBy.
Returns
`GroupedDataFrame`: A GroupedDataFrame object.
Example

    df.groupBy('column1')
    df.groupBy('column1', 'column2')
    df.groupBy('column1', 'column2').listGroups()
    df.groupBy('column1', 'column2').show()
    df.groupBy('column1', 'column2').aggregate((group) => group.count())

▸ sortBy(columnName, [reverse])

Sort DataFrame rows based on a column values. The row should contains only one variable type.

sortBy(columnName: String, reverse: [Boolean]): DataFrame
Parameters
columnName `(String)` The column giving order.
reverse `([Boolean] (default `false`) )` Reverse mode. Reverse the order if true.
Returns
`DataFrame`: An ordered DataFrame.
Example

    df.sortBy('id')

▸ union(dfToUnion)

Concat two DataFrames.

union(dfToUnion: DataFrame): DataFrame
Parameters
dfToUnion `(DataFrame)` The DataFrame to concat.
Returns
`DataFrame`: A new concatenated DataFrame resulting of the union.
Example

    df.union(df2)

▸ join(dfToJoin, columnNames, [how])

Join two DataFrames.

join(dfToJoin: DataFrame, columnNames: (String | Array), how: [String]): DataFrame
Parameters
dfToJoin `(DataFrame)` The DataFrame to join.
columnNames `((String | Array))` The selected columns for the join.
how `([String] (default `'inner'`) )` The join mode. Can be: full, inner, outer, left, right.
Returns
`DataFrame`: The joined DataFrame.
Example

    df.join(df2, 'column1', 'full')

▸ innerJoin(dfToJoin, columnNames)

Join two DataFrames with inner mode.

innerJoin(dfToJoin: DataFrame, columnNames: (String | Array)): DataFrame
Parameters
dfToJoin `(DataFrame)` The DataFrame to join.
columnNames `((String | Array))` The selected columns for the join.
Returns
`DataFrame`: The joined DataFrame.
Example

    df.innerJoin(df2, 'id')
    df.join(df2, 'id')
    df.join(df2, 'id', 'inner')

▸ fullJoin(dfToJoin, columnNames)

Join two DataFrames with full mode.

fullJoin(dfToJoin: DataFrame, columnNames: (String | Array)): DataFrame
Parameters
dfToJoin `(DataFrame)` The DataFrame to join.
columnNames `((String | Array))` The selected columns for the join.
Returns
`DataFrame`: The joined DataFrame.
Example

    df.fullJoin(df2, 'id')
    df.join(df2, 'id', 'full')

▸ outerJoin(dfToJoin, columnNames)

Join two DataFrames with outer mode.

outerJoin(dfToJoin: DataFrame, columnNames: (String | Array)): DataFrame
Parameters
dfToJoin `(DataFrame)` The DataFrame to join.
columnNames `((String | Array))` The selected columns for the join.
Returns
`DataFrame`: The joined DataFrame.
Example

    df2.rightJoin(df2, 'id')
    df2.join(df2, 'id', 'outer')

▸ leftJoin(dfToJoin, columnNames)

Join two DataFrames with left mode.

leftJoin(dfToJoin: DataFrame, columnNames: (String | Array)): DataFrame
Parameters
dfToJoin `(DataFrame)` The DataFrame to join.
columnNames `((String | Array))` The selected columns for the join.
Returns
`DataFrame`: The joined DataFrame.
Example

    df.leftJoin(df2, 'id')
    df.join(df2, 'id', 'left')

▸ rightJoin(dfToJoin, columnNames)

Join two DataFrames with right mode.

rightJoin(dfToJoin: DataFrame, columnNames: (String | Array)): DataFrame
Parameters
dfToJoin `(DataFrame)` The DataFrame to join.
columnNames `((String | Array))` The selected columns for the join.
Returns
`DataFrame`: The joined DataFrame.
Example

    df.rightJoin(df2, 'id')
    df.join(df2, 'id', 'right')

### GroupedDataFrame

src/groupedDataframe.js

Grouped DataFrame structure grouping DataFrame rows by column value.

new GroupedDataFrame()
Instance Members
▸ constructor(df, columnName, columnNames)

Create a GroupedDataFrame. Used in DataFrame.groupBy('columnName').

constructor(df: DataFrame, columnName: String, columnNames: ...any)
Parameters
df `(DataFrame)` The DataFrame to group by.
columnName `(String)` The column used for the group by.
columnNames `(...any)`
Example

    df.groupBy('column1');
    //or
    new GroupedDataFrame(df, 'column1');

▸ toCollection()

Convert GroupedDataFrame into collection (Array) of dictionnaries (Object).

toCollection(): Array
Returns
`Array`: An Array containing group: {groupKey, group}.
Example

    groupedDF.toCollection();

▸ show([quiet])

Display the GroupedDataFrame as String Table.

show(quiet: [Boolean]): String
Parameters
quiet `([Boolean] (default `false`) )` Quiet mode. If true, it doesn't trigger console.log().
Returns
`String`: The GroupedDataFrame as String Table.
Example

    groupedDf.show()

▸ listGroups()

List GroupedDataFrame groups.

listGroups(): Array
Returns
`Array`: An Array containing GroupedDataFrame group names.
Example

    gdf.listGroups()

▸ listHashs()

List GroupedDataFrame groups as a hashCode.

listHashs(): Array
Returns
`Array`: An Array containing GroupedDataFrame hash codes.
Example

    gdf.listHashCodes()

▸ aggregate(func)

Create an aggregation from a function.

aggregate(func: Function): DataFrame
Parameters
func `(Function)` The aggregation function.
Returns
`DataFrame`: A new DataFrame with a column 'aggregation' containing the result.
Example

    groupedDF.aggregate(group => group.stat.sum('column1'));

### Stat

src/modules/stat.js

Stat module for DataFrame, providing basic statistical metrics for numeric columns.

new Stat()
Instance Members
▸ constructor(df)

Start the Stat module.

constructor(df: DataFrame)
Parameters
df `(DataFrame)` An instance of DataFrame.
▸ sum(columnName)

Compute the sum of a numeric column.

sum(columnName: String): Number
Parameters
columnName `(String)` The column to evaluate, containing Numbers.
Returns
`Number`: The sum of the column.
Example

    df.stat.sum('column1')

▸ max(columnName)

Compute the maximal value into a numeric column.

max(columnName: String): Number
Parameters
columnName `(String)` The column to evaluate, containing Numbers.
Returns
`Number`: The maximal value into the column.
Example

    df.stat.max('column1')

▸ min(columnName)

Compute the minimal value into a numeric column.

min(columnName: String): Number
Parameters
columnName `(String)` The column to evaluate, containing Numbers.
Returns
`Number`: The minimal value into the column.
Example

    df.stat.min('column1')

▸ mean(columnName)

Compute the mean value into a numeric column.

mean(columnName: String): Number
Parameters
columnName `(String)` The column to evaluate, containing Numbers.
Returns
`Number`: The mean value into the column.
Example

    df.stat.mean('column1')

▸ average(columnName)

Compute the mean value into a numeric column. Alias from mean.

average(columnName: String): Number
Parameters
columnName `(String)` The column to evaluate, containing Numbers.
Returns
`Number`: The mean value into the column.
Example

    df.stat.min('column1')

▸ var(columnName, [population])

Compute the variance into a numeric column.

var(columnName: String, population: [Boolean]): Number
Parameters
columnName `(String)` The column to evaluate, containing Numbers.
population `([Boolean] (default `false`) )` Population mode. If true, provide the population variance, not the sample one.
Returns
`Number`: The variance into the column.
Example

    df.stat.var('column1')

▸ sd(columnName, [population])

Compute the standard deviation into a numeric column.

sd(columnName: String, population: [Boolean]): Number
Parameters
columnName `(String)` The column to evaluate, containing Numbers.
population `([Boolean] (default `false`) )` Population mode. If true, provide the population standard deviation, not the sample one.
Returns
`Number`: The standard deviation into the column.
Example

    df.stat.sd('column1')

▸ stats(columnName)

Compute all the stats available with the Stat module on a numeric column.

stats(columnName: String): Object
Parameters
columnName `(String)` The column to evaluate, containing Numbers.
Returns
`Object`: An dictionnary containing all statistical metrics available.
Example

    df.stat.stats('column1')

### Matrix

src/modules/matrix.js

Matrix module for DataFrame, providing basic mathematical matrix computations.

new Matrix()
Instance Members
▸ constructor(df)

Start the Matrix module.

constructor(df: DataFrame)
Parameters
df `(DataFrame)` An instance of DataFrame.
▸ isCommutative(df, [reverse])

Check if two DataFrames are commutative, if both have the same dimensions.

isCommutative(df: DataFrame, reverse: [Boolean]): Boolean
Parameters
df `(DataFrame)` The second DataFrame to check.
reverse `([Boolean] (default `false`) )` Revert the second DataFrame before the comparison.
Returns
`Boolean`: True if they are commutative, else false.
Example

    df.matrix.isCommutative(df2)

▸ add(df)

Provide an elements pairwise addition of two DataFrames having the same dimensions.

add(df: DataFrame): DataFrame
Parameters
df `(DataFrame)` The second DataFrame to add.
Returns
`DataFrame`: A new DataFrame resulting to the addition two DataFrames.
Example

    df.matrix.add(df2)

▸ product(number)

Provide a scalar product between a number and a DataFrame.

product(number: Number): DataFrame
Parameters
number `(Number)` The number to multiply.
Returns
`DataFrame`: A new DataFrame resulting to the scalar product.
Example

    df.matrix.product(6)

▸ dot(df)

Multiply one DataFrame n x p and a second p x n.

dot(df: DataFrame): DataFrame
Parameters
df `(DataFrame)` The second DataFrame to multiply.
Returns
`DataFrame`: A new n x n DataFrame resulting to the product of two DataFrame.
Example

    df.matrix.dot(df)

### SQL

src/modules/sql.js

SQL module for DataFrame, providing SQL-like syntax for data exploration in DataFrames.

new SQL()
Static Members
▸ request(query)

Request on a SQL query.

request(query: String): any
Parameters
query `(String)` A SQL query to request.
Returns
`any`: The result of the query.
Example

    DataFrame.request('SELECT * FROM tmp');

▸ dropTables()

Drop or remove all registered tables.

dropTables()
Example

    DataFrame.dropTables();

▸ dropTable(tableName)

Drop or remove a registered table.

dropTable(tableName: String)
Parameters
tableName `(String)` The registered table to drop.
Example

    DataFrame.dropTable('tmp1');

▸ renameTable(tableName, replacement, [overwrite])

Rename a registered table.

renameTable(tableName: String, replacement: String, overwrite: [Boolean])
Parameters
tableName `(String)` The registered table to rename.
replacement `(String)` The new table name.
overwrite `([Boolean] (default `false`) )` Overwrite if the table already exists.
Example

    DataFrame.renameTable('tmp1', 'notTmp1');

▸ listTables()

List all registered tables.

listTables(): Array
Returns
`Array`: A list of the registered tables.
Example

    DataFrame.listTables();

▸ registerTable(df, tableName, [overwrite])

Register a DataFrame as a temporary table.

registerTable(df: DataFrame, tableName: String, overwrite: [Boolean])
Parameters
df `(DataFrame)` The DataFrame to register.
tableName `(String)` The temporary table name.
overwrite `([Boolean] (default `false`) )` Overwrite if the table already exists.
Example

    DataFrame.registerTable('tmp', df);

Instance Members
▸ constructor(df)

Start the SQL module.

constructor(df: DataFrame)
Parameters
df `(DataFrame)` An instance of DataFrame.
▸ register(tableName, [overwrite])

Register the DataFrame as temporary table.

register(tableName: String, overwrite: [Boolean])
Parameters
tableName `(String)` The name of the table.
overwrite `([Boolean] (default `false`) )` Overwrite if the table already exists.
Example

    df.sql.register('tmp');

### Row

src/row.js

Row data structure used into the dataframe-js.

new Row()
Instance Members
▸ constructor(data, columns)

Create a new Row.

constructor(data: (Array | Object | Row), columns: Array)
Parameters
data `((Array | Object | Row))` The data of the Row.
columns `(Array)` The DataFrame column names.
Example

    new Row({
         'column1': 3,
         'column2': 6,
    })

    new Row([3, 6], ['column1', 'column2'])

    new Row(Row, ['column1', 'column3'])

▸ toDict()

Convert Row into dict / hash / object.

toDict(): Object
Returns
`Object`: The Row converted into dict.
Example

    row.toDict()

▸ toArray()

Convert Row into Array, loosing column names.

toArray(): Array
Returns
`Array`: The Row values converted into Array.
Example

    row.toArray()

▸ size()

Get the Row size.

size(): Int
Returns
`Int`: The Row length.
Example

    row.size()

▸ has(columnName)

Check if row contains a column.

has(columnName: String): Boolean
Parameters
columnName `(String)` The column to check.
Returns
`Boolean`: The presence or not of the column.
Example

    row.has('column1')

▸ select(columnNames)

Select columns into the Row.

select(columnNames: ...String): Row
Parameters
columnNames `(...String)` The columns to select.
Returns
`Row`: A new Row containing only the selected columns.
Example

    row.select('column1', 'column2')

▸ get(columnToGet)

Get a Row value by its column.

get(columnToGet: String): any
Parameters
columnToGet `(String)` The column value to get.
Returns
`any`: The selected value.
Example

    row.get('column1')

▸ set(columnToSet, value)

Set a Row value by its column, or create a new value if column doesn't exist.

set(columnToSet: String, value: any): Row
Parameters
columnToSet `(String)` The column value to set.
value `(any)`
Returns
`Row`: A new Row with the modified / new value.
Example

    row.set('column1', 6)

▸ delete(columnToDel)

Delete a Row value by its column.

delete(columnToDel: String): Row
Parameters
columnToDel `(String)` The column value to delete.
Returns
`Row`: A new Row without the deleted value.
Example

    row.delete('column1')