I'm currently using panda for data science purposes, which is very unoriginal, so I'm sure there's a better way than mine of adding columns to a dataframe calculated from the others, in an excel fashion.
For example, I've got a dataframe in which I've got a mass and a period, and I'd like to add a column with (M/P)^(1/3), M and P being converted in the appropriate units. I then write
day_sec=60.0*60.0*24.0
Msun=1.989 * 10**30
clean=reduced.dropna()
v=pd.DataFrame(clean['orbital_period'].apply(lambda x: x**(1/3.0))/clean['star_mass'].apply(lambda x: x**(1/3.0)), columns=list('v'))*day_sec/(Msun**(1/3.0))
clean.append(v)
Which doesn't even act like I want, and is very complicated both to write and read (here, the equation was very very simple). Any suggestion?
df['c'] = df['a'] + df['b'].