I have a list of objects where objects can be lists or scalars. I want an flattened list with only scalars. Eg:
L = [35,53,[525,6743],64,63,[743,754,757]] ou
it could be done neatly in one line using numpy
numpy
import numpy as np np.hstack(l)
you end up with an ndarray
array([ 35, 53, 525, 6743, 64, 63, 743, 754, 757])