listKeyGen

outputting.listKeyGen(data, maxListLen=None, returnList=False, abridge=False)[source]

Identifies the columns necessary to convert a list into a table

Parameters:
  • data (numpy.ndarray or list) – The list to be broken down
  • maxListLen (int or float with no decimal places or None, optional) – The length of the longest expected list. Only useful if returnList is True. Default None
  • returnList (bool, optional) – Defines if the lists will be broken into 1D lists or values. Default False, lists will be broken into values
  • abridge (bool, optional) – Defines if the final dataset will be a summary or the whole lot. If it is a summary, lists of more than 10 elements are removed. Default False, not abridged
Returns:

  • returnList (None or list of tuples of ints or ints) – The list of co-ordinates for the elements to be extracted from the data. If None the list is used as-is.
  • maxListLen (int or float with no decimal places or None, optional) – If returnList is True this should be the length of the longest list. If returnList is False this should return its original value

Examples

>>> listKeyGen([[1, 2, 3, 4, 5, 6], [4, 5, 6, 7, 8, 9]], maxListLen=None, returnList=False, abridge=False)
(array([[0, 0], [1, 0], [0, 1], [1, 1], [0, 2], [1, 2], [0, 3], [1, 3], [0, 4], [1, 4], [0, 5], [1, 5]]), 1)
>>> listKeyGen([[1, 2, 3, 4, 5, 6], [4, 5, 6, 7, 8, 9]], maxListLen=None, returnList=False, abridge=True)
(None, None)
>>> listKeyGen([[1, 2, 3, 4, 5, 6], [4, 5, 6, 7, 8, 9]], maxListLen=None, returnList=True, abridge=True)
(array([[0],
       [1]]), 6L)