Hellooo
I want to create a new column (D) that includes calculations from previous columns (A,B,C).
How could I do that?
CodePudding user response:
You can use assign() method in Pandas to create a new column D.
Example:
df = df.assign(D=df["A"] df["B"] df["C"])
CodePudding user response:
Just do so directly
df["D"] = df["A"] df["B"] df["C"]