import re


def flatten(py_array):
    """
        Takes a python array and flattens it's 'dimensions'.

    """

    flattened = re.sub(r'[\[,\]]', '', str(py_array)).split()
    return [float(i) for i in flattened]