You are trying to use a numpy arrays attribute for a normal list.
When you write x_train = [] that creates an empty list and data is added to it with the loop. Then with x_train.shape[1] you treat it as numpy array. If you want the length of your list, or how many elements it contains, you can use len(x_train)
x_train is defined as an empty list []. As stated in the error, lists don't have any attribute called shape.
I'm assuming you're trying to use it as if it were a numpy array.
If you want a more in-depth tutorial on how to use it, see https://www.w3schools.com/python/numpy/numpy_array_shape.asp
Basically, the shape attribute exists on numpy arrays, not regular python arrays.
You can create numpy arrays with np.array - for example, np.array([1, 2, 3, 4, 5]).
Use numpy.array to use shape attribute.
>>> import numpy as np
>>> X = np.array([
... [[-9.035250067710876], [7.453250169754028], [33.34074878692627]],
... [[-6.63700008392334], [5.132999956607819], [31.66075038909912]],
... [[-5.1272499561309814], [8.251499891281128], [30.925999641418457]]
... ])
>>> X.shape
(3L, 3L, 1L)
NOTE X.shape returns 3-items tuple for the given array; [n, T] = X.shape raises ValueError.
Alternatively, you can use np.shape(...)
For instance:
import numpy as np
a=[1,2,3]
and np.shape(a) will give an output of (3,)