def haystack_to_series_of_lists(haystack, index=None): if index is None: index = toolz.first(piece.index for piece in haystack if hasattr(piece, 'index')) pieces = reduce(operator.add, (pd.Series(getattr(piece, 'values', piece), index=index).map(ibis.util.promote_list) for piece in haystack)) return pieces
def execute_series_join_scalar_sep(op, sep, data, **kwargs): return reduce(lambda x, y: x + sep + y, data)