DataFrame.FromMatrix Method

Definition

Namespace: Numerics.NET.DataAnalysis
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4

Overload List

FromMatrix<C, T>(Matrix<T>, Index<C>) Constructs a new data frame from a matrix with a default row index.
FromMatrix<R, C, T>(Matrix<T>, Index<R>, Index<C>) Constructs a new data frame from a matrix.

FromMatrix<C, T>(Matrix<T>, Index<C>)

Constructs a new data frame from a matrix with a default row index.
C#
public static DataFrame<long, C> FromMatrix<C, T>(
	Matrix<T> values,
	Index<C> columnIndex
)

Parameters

values  Matrix<T>
A matrix.
columnIndex  Index<C>
The column index of the new data frame.

Type Parameters

C
The element type of columnIndex.
T
The element type of the matrix.

Return Value

DataFrame<Int64, C>
A data frame containing the columns of values as its columns.

Exceptions

ArgumentNullException

values is null.

-or-

columnIndex is null.

DimensionMismatchException

The length of columnIndex does not equal the number of columns in values.

FromMatrix<R, C, T>(Matrix<T>, Index<R>, Index<C>)

Constructs a new data frame from a matrix.
C#
public static DataFrame<R, C> FromMatrix<R, C, T>(
	Matrix<T> values,
	Index<R> rowIndex,
	Index<C> columnIndex
)

Parameters

values  Matrix<T>
A matrix.
rowIndex  Index<R>
The row index of the new data frame.
columnIndex  Index<C>
The column index of the new data frame.

Type Parameters

R
The element type of rowIndex.
C
The element type of columnIndex.
T
The element type of the matrix.

Return Value

DataFrame<R, C>
A data frame containing the columns of values as its columns.

Exceptions

ArgumentNullException

values is null.

-or-

rowIndex is null.

-or-

columnIndex is null.

DimensionMismatchException

The length of rowIndex does not equal the number of rows in values.

-or-

The length of columnIndex does not equal the number of columns in values.

See Also