Subtract a column from one pandas dataframe from another

前端 未结 1 1736
执笔经年
执笔经年 2021-01-13 12:20

I\'m sorry for a dumb question, but I cannot find any way to do this easily.

I have two pandas data frames in Python 2.7, which are indexed by tenor:

1条回答
  •  悲&欢浪女
    2021-01-13 12:45

    rates.sub(treas.iloc[:,0],axis=0).dropna()
    

    or

    rates.sub(treas.squeeze(),axis=0).dropna()
    

    0 讨论(0)
提交回复
热议问题