logoalt Hacker News

el_onilast Monday at 2:16 PM1 replyview on HN

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

Replies

tehnubtoday at 4:19 AM

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