Answers for "create multi new column from apply pandas"

0

create multi new column from apply pandas

df[['square x', 'cube x']] = df['col x'].apply(f)
Posted by: Guest on April-28-2021
0

create multi new column from apply pandas

def f(x):
    return pd.Series([x*x, x*x*x])
Posted by: Guest on April-28-2021

Code answers related to "create multi new column from apply pandas"

Python Answers by Framework

Browse Popular Code Answers by Language