While looking for a way to split a column into multiple columns within a loop, I stumbled upon a list of useful Pandas snippets containing this expression:
# Split delimited values in a DataFrame column into two new columns
df['new_col1'], df['new_col2'] = zip(*df['original_col'].apply(lambda x: x.split(': ', 1)))
which works perfectly, but I am not able to understand how it operates, in particular with respect to the * sign. Until now, I have seen asterisks only in functions definitions and I have not been able to find any documentation for this case.
Could anyone explain how it works?