Extreme Optimization™: Complexity made simple.

Math and Statistics
Libraries for .NET

  • Home
  • Features
    • Math Library
    • Vector and Matrix Library
    • Statistics Library
    • Performance
    • Usability
  • Documentation
    • Introduction
    • Math Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Resources
    • Downloads
    • QuickStart Samples
    • Sample Applications
    • Frequently Asked Questions
    • Technical Support
  • Order
  • Company
    • About us
    • Testimonials
    • Customers
    • Press Releases
    • Careers
    • Partners
    • Contact us
Introduction
Deployment Guide
Nuget packages
Configuration
Using Parallelism
Expand Mathematics Library User's GuideMathematics Library User's Guide
Expand Vector and Matrix Library User's GuideVector and Matrix Library User's Guide
Expand Data Analysis Library User's GuideData Analysis Library User's Guide
Expand Statistics Library User's GuideStatistics Library User's Guide
Expand Data Access Library User's GuideData Access Library User's Guide
Expand ReferenceReference

Skip Navigation LinksHome»Documentation»Reference»Extreme.DataAnalysis.Linq»LinqExtensions Class»Methods»ToLookup Method Overloads»ToLookup(R, C, TKey, TElement) Method (DataFrame(R, C), Func(DataFrameRow(R, C), TKey), Func(DataFrameRow(R, C), TElement), IEqualityComparer(TKey))

LinqExtensionsToLookupR, C, TKey, TElement Method (DataFrameR, C, FuncDataFrameRowR, C, TKey, FuncDataFrameRowR, C, TElement, IEqualityComparerTKey)

Extreme Optimization Numerical Libraries for .NET Professional
Creates a lookup for the data frame according to the specified key selector and element selector function.

Namespace:  Extreme.DataAnalysis.Linq
Assembly:  Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
Syntax

C#
VB
C++
F#
Copy
public static LinqExtensionsLookup<TKey, TElement> ToLookup<R, C, TKey, TElement>(
	this DataFrame<R, C> frame,
	Func<DataFrameRow<R, C>, TKey> keySelector,
	Func<DataFrameRow<R, C>, TElement> elementSelector,
	IEqualityComparer<TKey> comparer
)
<ExtensionAttribute>
Public Shared Function ToLookup(Of R, C, TKey, TElement) ( 
	frame As DataFrame(Of R, C),
	keySelector As Func(Of DataFrameRow(Of R, C), TKey),
	elementSelector As Func(Of DataFrameRow(Of R, C), TElement),
	comparer As IEqualityComparer(Of TKey)
) As LinqExtensionsLookup(Of TKey, TElement)
public:
[ExtensionAttribute]
generic<typename R, typename C, typename TKey, typename TElement>
static LinqExtensionsLookup<TKey, TElement>^ ToLookup(
	DataFrame<R, C>^ frame, 
	Func<DataFrameRow<R, C>^, TKey>^ keySelector, 
	Func<DataFrameRow<R, C>^, TElement>^ elementSelector, 
	IEqualityComparer<TKey>^ comparer
)
[<ExtensionAttribute>]
static member ToLookup : 
        frame : DataFrame<'R, 'C> * 
        keySelector : Func<DataFrameRow<'R, 'C>, 'TKey> * 
        elementSelector : Func<DataFrameRow<'R, 'C>, 'TElement> * 
        comparer : IEqualityComparer<'TKey> -> LinqExtensionsLookup<'TKey, 'TElement> 

Parameters

frame
Type: Extreme.DataAnalysisDataFrameR, C
A data frame to project.
keySelector
Type: SystemFuncDataFrameRowR, C, TKey
A function to extract a key from each row.
elementSelector
Type: SystemFuncDataFrameRowR, C, TElement
A function that transforms each row into a result.
comparer
Type: System.Collections.GenericIEqualityComparerTKey
An IEqualityComparerT to compare keys.

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.
TKey
The type of the key returned by keySelector.
TElement
The type of the result returned by elementSelector.

Return Value

Type: LinqExtensionsLookupTKey, TElement
A LinqExtensionsLookupTKey, T that contains keys and values.

Usage Note

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

ExceptionCondition
ArgumentNullException

frame is .

-or-

keySelector is .

-or-

elementSelector is .

Remarks

If comparer is , the Default is used to compare keys.

See Also

Reference

LinqExtensions Class
ToLookup Overload
Extreme.DataAnalysis.Linq Namespace

Copyright (c) 2004-2023 ExoAnalytics Inc.

Send comments on this topic to support@extremeoptimization.com

Copyright © 2004-2023, Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual Studio.NET, and the Optimized for Visual Studio logo
are registered trademarks of Microsoft Corporation.