I've come across an issue with pandas subtraction that confuses me. I am trying to do subtraction of one column with another. My data that is used are the residuals of arch_model, and ARIMAresult.
Heres the issue. When i perform pandas subtraction, my whole column gets altered to a single value (value of first row) instead of doing what it is supposed to.
residuals.fitted_garch = residuals.arma_resid - residuals.garch_resid
arma_resid garch_resid fitted_garch
Gmt time
2010-01-02 0.000012 -0.000004 0.000016
2010-01-03 -0.004926 -0.004943 0.000016
2010-01-04 -0.000392 -0.000408 0.000016
2010-01-05 -0.001888 -0.001905 0.000016
2010-01-06 0.002209 0.002193 0.000016
... ... ... ...
2019-12-27 -0.000043 -0.000059 0.000016
2019-12-28 0.000007 -0.000009 0.000016
2019-12-29 -0.002366 -0.002382 0.000016
2019-12-30 -0.003173 -0.003189 0.000016
2019-12-31 -0.000101 -0.000117 0.000016
Both residuals are pandas series
Would greatly appreciate if you could explain whats going on and provide advice on the fix.
Follow up - Code, dataframe, and result
From the screenshot above, we can see that the result of all the rows in the column is the value of the cell in the first row.