LinqExtensions.Where Method

Definition

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

Overload List

Where<T>(Vector<T>, Func<T, Boolean>) Filters the elements of a vector based on a predicate.
Where<T>(Vector<T>, Func<T, Int32, Boolean>) Filters the elements of a vector based on a predicate. Each element's index is used in the logic of the predicate function.
Where<R, C>(DataFrame<R, C>, Func<DataFrameRow<R, C>, Boolean>) Filters the rows of a data frame based on a predicate.
Where<R, C>(DataFrame<R, C>, Func<DataFrameRow<R, C>, Int32, Boolean>) Filters the rows of a data frame based on a predicate. Each row's index is used in the logic of the predicate function.

Where<R, C>(DataFrame<R, C>, Func<DataFrameRow<R, C>, Boolean>)

Filters the rows of a data frame based on a predicate.
C#
public static DataFrame<R, C> Where<R, C>(
	this DataFrame<R, C> frame,
	Func<DataFrameRow<R, C>, bool> predicate
)

Parameters

frame  DataFrame<R, C>
A data frame to filter.
predicate  Func<DataFrameRow<R, C>, Boolean>
A function to test each row for a condition.

Type Parameters

R
The element type of the row index of the data frame.
C
The element type of the column index of the data frame.

Return Value

DataFrame<R, C>
A data frame that contains the rows from frame that satisfy the condition.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DataFrame<R, C>. 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).

Exceptions

ArgumentNullException

frame is null.

-or-

predicate is null.

Where<R, C>(DataFrame<R, C>, Func<DataFrameRow<R, C>, Int32, Boolean>)

Filters the rows of a data frame based on a predicate. Each row's index is used in the logic of the predicate function.
C#
public static DataFrame<R, C> Where<R, C>(
	this DataFrame<R, C> frame,
	Func<DataFrameRow<R, C>, int, bool> predicate
)

Parameters

frame  DataFrame<R, C>
A data frame to filter.
predicate  Func<DataFrameRow<R, C>, Int32, Boolean>
A function to test each row for a condition.

Type Parameters

R
The element type of the row index of the data frame.
C
The element type of the column index of the data frame.

Return Value

DataFrame<R, C>
A data frame that contains the rows from frame that satisfy the condition.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DataFrame<R, C>. 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).

Exceptions

ArgumentNullException

frame is null.

-or-

predicate is null.

Where<T>(Vector<T>, Func<T, Boolean>)

Filters the elements of a vector based on a predicate.
C#
public static Vector<T> Where<T>(
	this Vector<T> vector,
	Func<T, bool> predicate
)

Parameters

vector  Vector<T>
A vector to filter.
predicate  Func<T, Boolean>
A function to test each element for a condition.

Type Parameters

T
The element type of the vector.

Return Value

Vector<T>
A vector that contains the elements from vector that satisfy the condition.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Vector<T>. 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).

Exceptions

ArgumentNullException

vector is null.

-or-

predicate is null.

Where<T>(Vector<T>, Func<T, Int32, Boolean>)

Filters the elements of a vector based on a predicate. Each element's index is used in the logic of the predicate function.
C#
public static Vector<T> Where<T>(
	this Vector<T> vector,
	Func<T, int, bool> predicate
)

Parameters

vector  Vector<T>
A vector to filter.
predicate  Func<T, Int32, Boolean>
A function to test each element for a condition. The second parameter of the function represents the index of the element.

Type Parameters

T
The element type of the vector.

Return Value

Vector<T>
A vector that contains the elements from vector that satisfy the condition.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Vector<T>. 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).

Exceptions

ArgumentNullException

vector is null.

-or-

predicate is null.

See Also