Data Frame<R, C>.Add Column Method
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.9.0
Overload List
| Add | Adds a column to the data frame. |
| Add | Adds a column to the data frame. |
| Add | Adds a column to the data frame. |
AddColumn(C, IVector)
Remarks
If values has a row index with the same element type as the data frame, a left join between the data frame's index and that index is used to determine the order of the elements of values in the new column.
If values has no index, or if the index has a different element type, elements are added in the order provided and their count must equal the existing row count. A first column in a completely empty data frame establishes its row count.
The new column has no explicit dataframe-owned metadata. Use SetColumnRole(C, ColumnRole) or SetColumnSemantics(C, ColumnSemanticInfo) to assign metadata after adding the column.
Exceptions
| Invalid | The data frame already contains a column with the specified key. |
| Argument | values is null. |
| Dimension | Positional input has a different length from the existing row axis. |
AddColumn<T>(C, Vector<T>)
public DataFrame<R, C> AddColumn<T>(
C key,
Vector<T> values
)
Parameters
Type Parameters
- T
Return Value
DataFrame<R, C>Remarks
If values has a row index with the same element type as the data frame, a left join between the data frame's index and that index is used to determine the order of the elements of values in the new column.
If values has no index, or if the index has a different element type, elements are added in the order provided and their count must equal the existing row count. A first column in a completely empty data frame establishes its row count.
The new column has no explicit dataframe-owned metadata. Use SetColumnRole(C, ColumnRole) or SetColumnSemantics(C, ColumnSemanticInfo) to assign metadata after adding the column.
Exceptions
| Argument | values is null. |
| Dimension | Positional input has a different length from the existing row axis. |
AddColumn<T>(C, IList<T>)
public DataFrame<R, C> AddColumn<T>(
C key,
IList<T> values
)
Parameters
Type Parameters
- T
Return Value
DataFrame<R, C>Remarks
If values has a row index with the same element type as the data frame, a left join between the data frame's index and that index is used to determine the order of the elements of values in the new column.
If values has no index, or if the index has a different element type, elements are added in the order provided and their count must equal the existing row count. A first column in a completely empty data frame establishes its row count.
The new column has no explicit dataframe-owned metadata. Use SetColumnRole(C, ColumnRole) or SetColumnSemantics(C, ColumnSemanticInfo) to assign metadata after adding the column.
Exceptions
| Argument | values is null. |
| Dimension | Positional input has a different length from the existing row axis. |