Lets say a dataframe looks like this
one two
a 1.0 1.0
b 2.0 2.0
c 3.0 3.0
d NaN 4.0
Adding new three column is like this
df["three"] = df["one"] * df["two"]
Result
one two three
a 1.0 1.0 1.0
b 2.0 2.0 4.0
c 3.0 3.0 9.0
d NaN 4.0 NaN
How about colum values that contains duplicate lists or list, and I need to create a new column and add the number with highest value
Example
one two
a 1.0 [12,1]
[12,1]
b 2.0 2.0
c 3.0 3.0
d NaN 4.0
So I want like this
one two flag
a 1.0 [12,1] 12
[12,1]
b 2.0 [200,400] 400
c 3.0 3.0 3.0
d NaN 4.0 4.0
Thanks