>>> df =DataFrame({\'a\':[1,2,3,4],\'b\':[2,4,6,8]}) >>> df[\'x\']=df.a + df.b >>> df[\'y\']=df.a - df.b >>> df a b x y 0
Feel free to disregard this solution as subtracting a list from an Index does not preserve the order of the original Index, if that's important.
In [61]: df.reindex(columns=pd.Index(['x', 'y']).append(df.columns - ['x', 'y'])) Out[61]: x y a b 0 3 -1 1 2 1 6 -2 2 4 2 9 -3 3 6 3 12 -4 4 8