Hi I would like to know the best way to do operations on columns in python using pandas.
I have a classical database which I have loaded as a dataframe, and I often have
Start with..
df = pd.DataFrame({'a':randrange(1,10),'b':randrange(10,20),'c':np.random.randn(10)})
a b c
0 7 12 0.475248
1 7 12 -1.090855
2 7 12 -1.227489
3 7 12 0.163929
end with...
df.ix[df.A < 1,df.A = df['c'] - df['d']]; df
a b c
0 7 12 5.000000
1 7 12 5.000000
2 7 12 5.000000
3 7 12 5.000000
4 7 12 1.813233