Thanks for the update.
Based on the Keras LSTM docs it seems that the input should have the shape:

inputs: A 3D tensor with shape [batch, timesteps, feature].

The linked Keras implementation uses tensors as:
X_test=np.reshape(X_test, (X_test.shape[0],X_test.shape[1],1))
X_train=np.reshape(X_train, (X_train.shape[0],X_train.shape[1],1))	
X_validation=np.reshape(X_validation, (X_validation.shape[0],X_validation.shape[1],1))	

so it seems that the feature dimension is set to one and the temporal dimension is large.
If I’m not misunderstanding the Keras docs or the posted Keras code, I guess this would be the main difference between both codes.