Andy Dyer
from prefect import Flow, flatten files = preprocess_csv.map(flatten(list_of_csvs))
Dominic Tarro
@task def flatten(nested: list[list]) -> list: return [el for arr in nested for el in arr]
flapili
nested = [list(range(5)) for x in range(5)] nested [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4], [0, 1, 2, 3, 4]] sum(nested, []) [0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4]
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.