Constructor
new DataFrame(columns, optionsopt)
- Source:
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
columns |
Object | Map | Object or Map where keys are the column names and the values are equilength vector-like objects. |
|||||||||||||||||||||||||||
options |
Object |
<optional> |
{}
|
Optional parameters. Properties
|
Extends
Classes
Methods
$removeColumn(i) → {DataFrame}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
i |
string | number | Column to remove, either by name or index. |
Returns:
A reference to this DataFrame after removing the specified column.
- Type
- DataFrame
$setColumn(i, value) → {DataFrame}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
i |
string | number | Identity of the column to add, either by name or index.
|
value |
* | Array-like column to set/add as the column. |
Returns:
A reference to this DataFrame after adding/replacing the specified column.
- Type
- DataFrame
$setColumnNames(names) → {DataFrame}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
names |
Array | Array of unique strings containing the new name for each column.
This should have the same length as |
Returns:
A reference to this DataFrame with modified column names.
- Type
- DataFrame
$setMetadata(value) → {Annotated}
- Source:
- Overrides:
Parameters:
Name | Type | Description |
---|---|---|
value |
Object | Object containing the metadata. |
Returns:
A reference to this Annotated object.
- Type
- Annotated
$setRowNames(namesnullable) → {DataFrame}
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
names |
Array |
<nullable> |
Array of unique strings containing the new name for each row.
This should have the same length as Alternatively, this may be |
Returns:
A reference to this DataFrame with modified row names.
- Type
- DataFrame
$sliceColumns(i, optionsopt) → {DataFrame}
- Source:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
i |
Array | Array of strings or indices specifying the columns to retain in the slice. This should refer to unique column names. |
||||||||||||
options |
Object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
Reference to this DataFrame after slicing to the specified columns.
If inPlace = true
, this is a reference to the current instance, otherwise a new instance is created and returned.
- Type
- DataFrame
column(i) → {*}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
i |
string | number | Column to retrieve, either by name or index. |
Returns:
The contents of column i
as a vector-like object.
- Type
- *
columnNames() → {Array}
- Source:
Returns:
Array of strings containing the column names in the specified order.
- Type
- Array
hasColumn(name) → {boolean}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of a column. |
Returns:
Whether the column exists in this DataFrame.
- Type
- boolean
metadata() → {Map}
- Source:
- Overrides:
Returns:
Map containing arbitrary metadata.
- Type
- Map
numberOfColumns() → {number}
- Source:
Returns:
Number of columns in this DataFrame.
- Type
- number
numberOfRows() → {number}
- Source:
Returns:
Number of rows in this DataFrame.
- Type
- number
removeColumn(i, optionsopt) → {DataFrame}
- Source:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
i |
string | number | Column to remove, either by name or index. |
||||||||||||
options |
Object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
The DataFrame after removing the specified column.
If inPlace = true
, this is a reference to the current instance, otherwise a new instance is created and returned.
- Type
- DataFrame
rowNames() → (nullable) {Array}
- Source:
Returns:
Array of strings containing row names, or null
if no row names are available.
- Type
- Array
setColumn(i, value, optionsopt) → {DataFrame}
- Source:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
i |
string | number | Identity of the column to add, either by name or index.
|
||||||||||||
value |
* | Array-like column to set/add as the column. |
||||||||||||
options |
Object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
The DataFrame after adding/replacing the specified column.
If inPlace = true
, this is a reference to the current instance, otherwise a new instance is created and returned.
- Type
- DataFrame
setColumnNames(names, optionsopt) → {DataFrame}
- Source:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
names |
Array | Array of unique strings containing the new name for each column.
This should have the same length as |
||||||||||||
options |
Object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
The DataFrame with modified column names.
If inPlace = true
, this is a reference to the current instance, otherwise a new instance is created and returned.
- Type
- DataFrame
setMetadata(value, optionsopt) → {Annotated}
- Source:
- Overrides:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
value |
Object | Map | Object containing the metadata. |
||||||||||||
options |
Object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
The Annotated object after replacing the metadata.
If inPlace = true
, this is a reference to the current instance, otherwise a new instance is created and returned.
- Type
- Annotated
setRowNames(namesnullable, optionsopt) → {DataFrame}
- Source:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
names |
Array |
<nullable> |
Array of unique strings containing the new name for each row.
This should have the same length as Alternatively, this may be |
|||||||||||
options |
Object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
The DataFrame with modified row names.
If inPlace = true
, this is a reference to the current instance, otherwise a new instance is created and returned.
- Type
- DataFrame
sliceColumns(i, optionsopt) → {DataFrame}
- Source:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
i |
Array | Array of strings or indices specifying the columns to retain in the slice. This should refer to unique column names. |
||||||||||||
options |
Object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
Reference to this DataFrame after slicing to the specified columns.
If inPlace = true
, this is a reference to the current instance, otherwise a new instance is created and returned.
- Type
- DataFrame