Data Frame<R, C>.Map And Replace Method
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.9.0
Overload List
| Map | Applies the specified function to selected columns. |
| Map | Applies the specified function to selected columns and replaces the columns with the mapped columns. |
| Map | Applies the specified function to selected columns. |
| Map | Applies the specified function to selected columns. |
| Map | Applies the specified function to selected columns and replaces the columns with the mapped columns. |
| Map | Applies the specified function to selected columns. |
MapAndReplace(C, Func<IVector, IVector>, C)
public DataFrame<R, C> MapAndReplace(
C columnKey,
Func<IVector, IVector> function,
C newColumnKey
)Parameters
- columnKey C
- the key of the column to map.
- function Func<IVector, IVector>
- The function to apply.
- newColumnKey C
- The list of keys of the mapped columns. If this value is null, the original column keys are used.
Return Value
DataFrame<R, C>A new data frame whose columns are function applied to the column with key in columnKey and column keys specified by newColumnKey.
Remarks
This operation replaces an existing logical column in place. When the column keeps its key, its dataframe-owned metadata is preserved. When the key changes, dataframe-owned metadata follows that column to newColumnKey, and no metadata remains attached to columnKey.
Exceptions
| Key | One or more of the keys in columnKey could not be found in the column index. |
MapAndReplace<T>(C, Func<Vector<T>, IVector>, C)
public DataFrame<R, C> MapAndReplace<T>(
C columnKey,
Func<Vector<T>, IVector> function,
C newColumnKey
)
Parameters
- columnKey C
- the key of the column to map.
- function Func<Vector<T>, IVector>
- The function to apply.
- newColumnKey C
- The list of keys of the mapped columns. If this value is null, the original column keys are used.
Type Parameters
- T
Return Value
DataFrame<R, C>A new data frame whose columns are function applied to the column with key in columnKey and column keys specified by newColumnKey.
Exceptions
| Key | One or more of the keys in columnKey could not be found in the column index. |
MapAndReplace(IList<C>, Func<IVector, IVector>, IList<C>)
public DataFrame<R, C> MapAndReplace(
IList<C> columnKeys,
Func<IVector, IVector> function,
IList<C> newColumnKeys
)Parameters
- columnKeys IList<C>
- A list of keys of the columns to map.
- function Func<IVector, IVector>
- The function to apply.
- newColumnKeys IList<C>
- The list of keys of the mapped columns. If this value is null, the original column keys are used.
Return Value
DataFrame<R, C>A new data frame whose columns are function applied to the columns with key in columnKeys and column keys specified by newColumnKeys.
Remarks
This operation replaces existing logical columns in place. When a column keeps its key, its dataframe-owned metadata is preserved. When a column key changes, dataframe-owned metadata follows that column position to the new key, and no metadata remains attached to the old key.
Exceptions
| Key | One or more of the keys in columnKeys could not be found in the column index. |
| Dimension | newColumnKeys is non-null and its count differs from columnKeys. |
MapAndReplace(IList<C>, Func<IVector, IVector>, Func<C, C>)
public DataFrame<R, C> MapAndReplace(
IList<C> columnKeys,
Func<IVector, IVector> function,
Func<C, C> keyGenerator
)Parameters
- columnKeys IList<C>
- A list of keys of the columns to map.
- function Func<IVector, IVector>
- The function to apply.
- keyGenerator Func<C, C>
- A function that maps old column keys to new column keys.
Return Value
DataFrame<R, C>A new data frame whose columns are function applied to the columns with key in columnKeys and column keys specified by keyGenerator applied to each key in columnKeys.
Exceptions
| Key | One or more of the keys in columnKeys could not be found in the column index. |
MapAndReplace<T>(IList<C>, Func<Vector<T>, IVector>, IList<C>)
public DataFrame<R, C> MapAndReplace<T>(
IList<C> columnKeys,
Func<Vector<T>, IVector> function,
IList<C> newColumnKeys
)
Parameters
- columnKeys IList<C>
- A list of keys of the columns to map.
- function Func<Vector<T>, IVector>
- The function to apply.
- newColumnKeys IList<C>
- The list of keys of the mapped columns. If this value is null, the original column keys are used.
Type Parameters
- T
Return Value
DataFrame<R, C>A new data frame whose columns are function applied to the columns with key in columnKeys and column keys specified by newColumnKeys.
Exceptions
| Key | One or more of the keys in columnKeys could not be found in the column index. |
MapAndReplace<T>(IList<C>, Func<Vector<T>, IVector>, Func<C, C>)
public DataFrame<R, C> MapAndReplace<T>(
IList<C> columnKeys,
Func<Vector<T>, IVector> function,
Func<C, C> keyGenerator
)
Parameters
- columnKeys IList<C>
- A list of keys of the columns to map.
- function Func<Vector<T>, IVector>
- The function to apply.
- keyGenerator Func<C, C>
- A function that maps old column keys to new column keys.
Type Parameters
- T
Return Value
DataFrame<R, C>A new data frame whose columns are function applied to the columns with key in columnKeys and column keys specified by keyGenerator applied to each key in columnKeys.
Exceptions
| Key | One or more of the keys in columnKeys could not be found in the column index. |