Table of Contents

Class List

Namespace
OpenMEPSandbox.Core
Assembly
OpenMEPSandbox.dll
public class List
Inheritance
List
Inherited Members

Methods

Difference(List<object>, List<object>)

Returns the items that are in the first list but not in the second list.

public static List<object> Difference(List<object> list1, List<object> list2)

Parameters

list1 List<dynamic>

The first list to compare.

list2 List<dynamic>

The second list to compare.

Returns

List<dynamic>

A new list containing the items that are in the first list but not in the second list.

Examples

List.Difference.dyn

IndexList(List<object>)

Returns a list of indices for a given list of objects.

public static List<object> IndexList(List<object> objects)

Parameters

objects List<dynamic>

Returns

List<dynamic>

list index of objects

Examples

List.IndexList.dyn

IndexObjects(List<object>)

Takes a list of doubles and returns a new list where each element is replaced with the index of its first occurrence in the input list. If an element appears multiple times in the input list, the index of its first occurrence is used.

public static List<int> IndexObjects(List<object> objects)

Parameters

objects List<dynamic>

The input list of strings to be indexed.

Returns

List<int>

A new list where each element is replaced with its corresponding index.

Examples

List.IndexObjects.dyn

IndexTwoListObjects(List<object>, List<object>)

Takes two lists as input and returns two indexed lists where each element is replaced with the index of its first occurrence in the input list.

[MultiReturn(new string[] { "lst1", "lst2" })]
public static Dictionary<string, object> IndexTwoListObjects(List<object> lst1, List<object> lst2)

Parameters

lst1 List<dynamic>

The first list to index.

lst2 List<dynamic>

The second list to index.

Returns

Dictionary<string, object>

A Tuple containing the two indexed lists.

Examples

List.IndexTwoListObjects.dyn

IndexUniqueObjects(List<object>)

This method takes a list of objects as input and returns a dictionary mapping each unique string to its corresponding index in the list.

[MultiReturn(new string[] { "name", "index" })]
public static Dictionary<string, object> IndexUniqueObjects(List<object> objects)

Parameters

objects List<dynamic>

list of objects input

Returns

Dictionary<string, object>

name of object

Examples

List.IndexUniqueObjects.dyn

IndexUniqueTwoListObjects(List<object>, List<object>)

Takes two lists of strings as input, merges them, and returns a dictionary with unique names and indices.

[MultiReturn(new string[] { "name", "index" })]
public static Dictionary<string, object> IndexUniqueTwoListObjects(List<object> list1, List<object> list2)

Parameters

list1 List<dynamic>

The first list of objects.

list2 List<dynamic>

The second list of objects.

Returns

Dictionary<string, object>

name of object

Examples

List.IndexUniqueTwoListObjects.dyn

Intersect(List<object>, List<object>)

Returns the items that are common to two lists.

public static List<object> Intersect(List<object> list1, List<object> list2)

Parameters

list1 List<dynamic>

The first list to intersect.

list2 List<dynamic>

The second list to intersect.

Returns

List<dynamic>

A new list containing the items that are common to both lists.

Examples

List.Intersect.dyn

OneHotEncode(List<string>)

Encodes a list of categorical values using one-hot encoding.

public static int[][] OneHotEncode(List<string> labels)

Parameters

labels List<string>

A list of categorical values to encode.

Returns

int[][]

An array of arrays representing the one-hot encoded values.

Examples

List.OneHotEncode.dyn