I used np.subtract () where I got the following error.
Cannot convert input [(0, slice(None, None, None))] of type to Timestamp
stock_open=panel_data['Open']
stock_close=panel_data['Close']
row,col=stock_close.shape
movements = np.zeros([row, col])
for i in range(0, row):
movements[i,:] = np.subtract(stock_close[i,:], stock_open[i,:])
The below line in my code:
movements[i,:] = np.subtract(stock_close[i,:], stock_open[i,:])
gives me the following error.
TypeError: Cannot convert input [(0, slice(None, None, None))] of type to Timestamp