Grouping.Window Method
Definition
Namespace: Numerics.NET.DataAnalysis
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.0
Overload List
Window( | Constructs a grouping that represents a moving window of fixed length. |
Window( | Constructs a grouping that represents a moving window of fixed length. |
Window<TInput>(Index<TInput>, Int32, Int32, Boolean, Int32) | Constructs a grouping that represents a moving window of fixed length. |
Window(IIndex, Int32, Int32, Boolean, Int32)
Constructs a grouping that represents a moving window of fixed length.
public static IGrouping Window(
IIndex index,
int size,
int offset = -1,
bool includePartialWindows = false,
int minCount = 0
)
Parameters
- index IIndex
- The index the grouping is over.
- size Int32
- The size of the window. Must be greater than zero.
- offset Int32 (Optional)
- The offset from the start of the window of the key that is used to represent the group in the grouping's index.
- includePartialWindows Boolean (Optional)
- Indicates whether windows at the boundaries that are smaller than size should be evaluated. The default is false.
- minCount Int32 (Optional)
- The minimum number of non-missing values in a window.
Return Value
IGroupingA grouping object that represents the moving window.
Remarks
When offset is less than zero, the key element is counted from the end of the window.
When includePartialWindows is false, the grouping will usually have fewer elements than the index. When includePartialWindows is true, the grouping has as many groups as there are keys in the index, but depending on the value of minCount, some entries may be missing.
Exceptions
Argument | index is null. |
Argument | size is less than or equal to zero. |
Window<TInput>(Index<TInput>, Int32, Int32, Boolean, Int32)
Constructs a grouping that represents a moving window of fixed length.
public static Grouping<TInput> Window<TInput>(
Index<TInput> index,
int size,
int offset = -1,
bool includePartialWindows = false,
int minCount = 0
)
Parameters
- index Index<TInput>
- The index the grouping is over.
- size Int32
- The size of the window. Must be greater than zero.
- offset Int32 (Optional)
- The offset from the start of the window of the key that is used to represent the group in the grouping's index.
- includePartialWindows Boolean (Optional)
- Indicates whether windows at the boundaries that are smaller than size should be evaluated. The default is false.
- minCount Int32 (Optional)
- (Optional.) The minimum number of observations required for aggregations over a window to have a value. The default is 0.
Type Parameters
- TInput
Return Value
Grouping<TInput>A grouping object that represents the moving window.
Exceptions
Argument | index is null. |
Argument | size is less than or equal to zero. |
Window(Int32, Int32, Int32, Boolean, Int32)
Constructs a grouping that represents a moving window of fixed length.
public static Grouping<long> Window(
int length,
int size,
int offset = -1,
bool includePartialWindows = false,
int minCount = 0
)
Parameters
- length Int32
- The total length of the data to group on.
- size Int32
- The size of the window. Must be greater than zero.
- offset Int32 (Optional)
- (Optional.) The offset from the start of the window of the key that is used to represent the group in the grouping's index. The default is -1, which indicates the last item in the interval.
- includePartialWindows Boolean (Optional)
- Indicates whether windows at the boundaries that are smaller than size should be evaluated.
- minCount Int32 (Optional)
- (Optional.) The minimum number of observations required for aggregations over a window to have a value. The default is 0.
Return Value
Grouping<Int64>A grouping object that represents the moving window.
Exceptions
Argument | size is less than or equal to zero. -or- size is less than or equal to zero. |