There's two dataframes, all the colnames are the same but the index is different. I've tried several ways but I've been getting NaN
. I'm guessing it is because it's trying to match the index but I am stuck.
I've tried:
df1.ix['Norm']-df2.ix['Norm']
df1 - df2.ix['Norm']
df1.astype(float) - df2.astype(float)
would like something like this
df1 - df2[df1.column.names]
When you don't want index-aligned arithmetic, get rid of the indexes. You can subtract the numpy arrays to the same effect:
(df1.values - df2[df1.column.names].values)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments