Returns a data frame containing all values in the data frame as row-column-value pairs.
Namespace:
Extreme.DataAnalysis
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static DataFrame<long, string> Stack<R>(
this DataFrame<R, string> frame,
IEnumerable<string> idColumns,
IEnumerable<string> valueColumns = null,
string variableKey = "variable",
string valueKey = "value"
)
<ExtensionAttribute>
Public Shared Function Stack(Of R) (
frame As DataFrame(Of R, String),
idColumns As IEnumerable(Of String),
Optional valueColumns As IEnumerable(Of String) = Nothing,
Optional variableKey As String = "variable",
Optional valueKey As String = "value"
) As DataFrame(Of Long, String)
public:
[ExtensionAttribute]
generic<typename R>
static DataFrame<long long, String^>^ Stack(
DataFrame<R, String^>^ frame,
IEnumerable<String^>^ idColumns,
IEnumerable<String^>^ valueColumns = nullptr,
String^ variableKey = L"variable",
String^ valueKey = L"value"
)
[<ExtensionAttribute>]
static member Stack :
frame : DataFrame<'R, string> *
idColumns : IEnumerable<string> *
?valueColumns : IEnumerable<string> *
?variableKey : string *
?valueKey : string
(* Defaults:
let _valueColumns = defaultArg valueColumns null
let _variableKey = defaultArg variableKey "variable"
let _valueKey = defaultArg valueKey "value"
*)
-> DataFrame<int64, string>
Parameters
- frame
- Type: Extreme.DataAnalysisDataFrameR, String
A data frame. - idColumns
- Type: System.Collections.GenericIEnumerableString
A sequence of keys of the identifier columns,
which remain unstacked. - valueColumns (Optional)
- Type: System.Collections.GenericIEnumerableString
A sequence of keys of the value columns,
which are stacked. - variableKey (Optional)
- Type: SystemString
The key of the value column in the result data frame. - valueKey (Optional)
- Type: SystemString
The key of the value column in the result data frame.
Type Parameters
- R
- The type of the row index of the data frame.
Return Value
Type:
DataFrameInt64,
StringA data frame with a column corresponding to each key in
idColumns, a column for the key of the value columns,
and a column for the value of the value columns.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
DataFrameR,
String. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Missing values are not recorded.
Reference