newListDict

outputting.newListDict(store, labelPrefix=u'', maxListLen=0)[source]

Takes a dictionary of numbers, strings, lists and arrays and returns a dictionary of 1D arrays.

If there is a single value, then a list is created with that value repeated

Parameters:
  • store (dict) – A dictionary of numbers, strings, lists, dictionaries and arrays
  • labelPrefix (string) – An identifier to be added to the beginning of each key string. Default empty string
Returns:

newStore – The new dictionary with the keys from the keySet and the values as 1D lists.

Return type:

dict

Examples

>>> store = {'list': [1, 2, 3, 4, 5, 6]}
>>> newListDict(store)
OrderedDict([('list', [1, 2, 3, 4, 5, 6])])
>>> store = {'string': 'string'}
>>> newListDict(store)
OrderedDict([('string', ['string'])])
>>> store = {'dict': {1: {3: "a"}, 2: "b"}}
>>> newListDict(store)
OrderedDict([(u'dict_1_3', ['a']), (u'dict_2', ['b'])])