← Back to context

Comment by el_oni

3 days ago

Ive only used reduce at work half a dozen times and it does raise an eyebrow each time.

But for unioning a bunch of spark dataframes together i think

    df = reduce(DataFrame.union, list_of_dfs) 

is much nicer than

    df, *rest = list_of_dfs

    for other in rest:
        df = df.union(other)

People just get a bit funny, especially now you have to import it from functools

Came here to comment this. I work on a team of functional-adverse devs, but they all happily use this one.