author: Vincent Nikolayev
Unpacks any array with nested-array type-containers to a 1D array.
- Able to preserve empty containers at their indices
- Able to preserve full strings or unpack them to single length strings ie. 'st' vs. ['s', 't']
- Pass in additional iterable types
- Implements recursion
- numpy: for the sole reason of passing in its ndarray type
array = [[[1], 2], ([3], [[4]]), (), 'string']
unpack(array)
out: [1, 2, 3, 4, (), 'string']
unpack(array, preserve_empties=False)
out: [1, 2, 3, 4, 'string']
unpack(array, preserve_empties=False, types=[str])
out: [1, 2, 3, 4, 's', 't', 'r', 'i', 'n', 'g']