DataFrame.FromColumns Method

Definition

Namespace: Extreme.DataAnalysis
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

FromColumns<C>(IDictionary<C, Object>) Constructs a new data frame from a dictionary of columns using a default index.
FromColumns<C>(ValueTuple<C, Object>[]) Constructs a new data frame from an array of tuples of key / column pairs using a default index.
FromColumns<C>(IEnumerable<IVector>, Index<C>) Constructs a new data frame from the specified columns and column index.
FromColumns<C>(IEnumerable<IVector>, IEnumerable<C>) Creates a new data frame from the specified column labels and data.
FromColumns<R, C>(IDictionary<C, Object>) Constructs a new data frame from a dictionary of columns.
FromColumns<R, C>(IDictionary<C, Object>, Index<R>) Constructs a new data frame from a dictionary of columns using the specified row index.
FromColumns<R, C>(IDictionary<C, Object>, Index<R>, Index<C>) Constructs a new data frame from a dictionary of columns using the specified row index.
FromColumns<R, C>(IEnumerable<IVector>, Index<R>, Index<C>) Constructs a new data frame from the specified columns, row and column indexes.

DataFrame.FromColumns<C>(IDictionary<C, Object>)

Constructs a new data frame from a dictionary of columns using a default index.
C#
public static DataFrame<long, C> FromColumns<C>(
	IDictionary<C, Object> columns
)

Parameters

>
columns  IDictionary<C, Object>
A dictionary that maps column keys to columns and is indexed by row number.

Type Parameters

>
C
The type of the column index.

Return Value

>DataFrame<Int64, C>
A data frame whose columns are indexed by the keys of columns and contain the collections in the values of columns.

Exceptions

ArgumentNullException

columns is null.

DataFrame.FromColumns<R, C>(IDictionary<C, Object>)

Constructs a new data frame from a dictionary of columns.
C#
public static DataFrame<R, C> FromColumns<R, C>(
	IDictionary<C, Object> columns
)

Parameters

>
columns  IDictionary<C, Object>
A dictionary that maps column keys to columns. At least one of the columns must be a vector with an index with element type R.

Type Parameters

>
R
The type of the row index.
C
The type of the column index.

Return Value

>DataFrame<R, C>
A data frame whose columns are indexed by the keys of columns and contain the collections in the values of columns. The rows are indexed by the index of the first column in the dictionary.

Exceptions

ArgumentNullException

columns is null.

InvalidOperationException

None of the columns in columns has an index with element type R.

DataFrame.FromColumns<C>(ValueTuple<C, Object>[])

Constructs a new data frame from an array of tuples of key / column pairs using a default index.
C#
public static DataFrame<long, C> FromColumns<C>(
	params (C , Object )[] columns
)

Parameters

>
columns  ValueTuple<C, Object>[]
An array of tuples that map column keys to columns and is indexed by row number.

Type Parameters

>
C
The type of the column index.

Return Value

>DataFrame<Int64, C>
A data frame whose columns are indexed by the keys of columns and contain the collections in the values of columns.

Exceptions

ArgumentNullException

columns is null.

DataFrame.FromColumns<R, C>(IDictionary<C, Object>, Index<R>)

Constructs a new data frame from a dictionary of columns using the specified row index.
C#
public static DataFrame<R, C> FromColumns<R, C>(
	IDictionary<C, Object> columns,
	Index<R> rowIndex
)

Parameters

>
columns  IDictionary<C, Object>
A dictionary that maps column keys to columns.
rowIndex  Index<R>
The row index for the data frame.

Type Parameters

>
R
The type of the row index.
C
The type of the column index.

Return Value

>DataFrame<R, C>
A data frame whose columns are indexed by the keys of columns and contain the collections in the values of columns. The rows are indexed by rowIndex.

Exceptions

ArgumentNullException

columns is null.

-or-

rowIndex is null.

DataFrame.FromColumns<C>(IEnumerable<IVector>, Index<C>)

Constructs a new data frame from the specified columns and column index.
C#
public static DataFrame<long, C> FromColumns<C>(
	IEnumerable<IVector> columns,
	Index<C> columnIndex
)

Parameters

>
columns  IEnumerable<IVector>
A sequence of data frame columns.
columnIndex  Index<C>
The column index of the new data frame.

Type Parameters

>
C

Return Value

>DataFrame<Int64, C>

Exceptions

ArgumentNullException

columns is null.

-or-

columnIndex is null.

DataFrame.FromColumns<C>(IEnumerable<IVector>, IEnumerable<C>)

Creates a new data frame from the specified column labels and data.
C#
public static DataFrame<long, C> FromColumns<C>(
	IEnumerable<IVector> columns,
	IEnumerable<C> columnKeys
)

Parameters

>
columns  IEnumerable<IVector>
A sequence of vectors containing the data.
columnKeys  IEnumerable<C>
A sequence of column keys.

Type Parameters

>
C
The type of the column keys

Return Value

>DataFrame<Int64, C>
A new data frame with the elements of columns as columns and with column index columnKeys.

Exceptions

ArgumentNullException

columns is null.

-or-

columnKeys is null.

DataFrame.FromColumns<R, C>(IDictionary<C, Object>, Index<R>, Index<C>)

Constructs a new data frame from a dictionary of columns using the specified row index.
C#
public static DataFrame<R, C> FromColumns<R, C>(
	IDictionary<C, Object> columns,
	Index<R> rowIndex,
	Index<C> columnIndex
)

Parameters

>
columns  IDictionary<C, Object>
A dictionary that maps column keys to columns.
rowIndex  Index<R>
The row index for the data frame.
columnIndex  Index<C>
The column index for the data frame.

Type Parameters

>
R
The type of the row index.
C
The type of the column index.

Return Value

>DataFrame<R, C>
A data frame whose columns are indexed by the keys of columnIndex and contain the collections in the values of columns. The rows are indexed by rowIndex. If a key in columnIndex is not found in columns, the corresponding column will contain missing values.

Exceptions

ArgumentNullException

columns is null.

-or-

rowIndex is null.

DataFrame.FromColumns<R, C>(IEnumerable<IVector>, Index<R>, Index<C>)

Constructs a new data frame from the specified columns, row and column indexes.
C#
public static DataFrame<R, C> FromColumns<R, C>(
	IEnumerable<IVector> columns,
	Index<R> rowIndex,
	Index<C> columnIndex
)

Parameters

>
columns  IEnumerable<IVector>
A sequence of data frame columns.
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
C

Return Value

>DataFrame<R, C>

Exceptions

ArgumentNullException

columns is null.

-or-

rowIndex is null.

-or-

columnIndex is null.

See Also