create multi new column from apply pandas code example
Example 1: create multi new column from apply pandas
def f(x):
return pd.Series([x*x, x*x*x])
Example 2: create multi new column from apply pandas
df[['square x', 'cube x']] = df['col x'].apply(f)