dataFrame — fromSerie()

Description

The fromSerie() method of the dataFrame object replaces all rows in the DataFrame with the specified values.

Signature

dataFrame.fromSerie(array, columnName)
Scope
dataFrame
Family
core
Returns
mutates

Arguments

serie (array)
The data serie used to replace the current contents of the DataFrame. The value must be a 1D array.
columnName (string)
The column name to insert into the DataFrame. If not set, the first value of the serie is used as the column header.

Example

// create an array of values
var serie = [ 1, 2, 3 ];
var columnName = 'UNNAMED';

// create a dataFrame
var dataFrame = new DataFrame();

// set the dataFrame column
dataFrame.fromSerie(serie, columnName);