listSelection

outputting.listSelection(data, loc)[source]

Allows numpy array-like referencing of lists

Parameters:
  • data (list) – The data to be referenced
  • loc (tuple of integers) – The location to be referenced
Returns:

selection – The referenced subset

Return type:

list

Examples

>>> listSelection([1, 2, 3], (0,))
1
>>> listSelection([[1, 2, 3], [4, 5, 6]], (0,))
[1, 2, 3]
>>> listSelection([[1, 2, 3], [4, 5, 6]], (0, 2))
3