unsupported operand type(s) for -: 'list' and 'list' using python Here I have a data file and I designed neural network to predict value. I have a three inputs. These three inputs affect to predict value bysubtarcting and adding. If my three inputs are x1,x2,x3 . X1 and X2 add together and that  value  will subtract with the X3 value and give the predict value. This process will happened in x_train. I wrote a code. But it gives me this error. Can nyone help me to solve this problem?
My code is,

data = pd.DataFrame(data,columns=['X1','X2','X3'])
data = data.values
a = []
for i in range(0,len(data)):
    X1 = data[i][0]
    a.append([X1]) 
b = []
for i in range(0,len(data)):
    X2 = data[i][1]
    b.append([X2])
c = []
for i in range(0,len(data)):
    X3 = data[i][2]
    c.append([X3])
x_train =[]
x =[]
for i in range(0,len(data)):
    x_train.append([a[i] ,b[i], c[i]])
    x.append((a[i] - b[i] + c[i]))
x_train =np.array(x_train)
x = np_array(x)
You are facing the error on the line x.append((a[i] - b[i] + c[i])) due to expression a[i] - b[i] + c[i]. Let us see the how it is being calculated. Suppose I have the following data:

array([[1, 2, 3],
       [4, 5, 6],
       [7, 8, 9]])


Then the values of a, b and c are:

a
Out[20]: [[1], [4], [7]]

b
Out[21]: [[2], [5], [8]]

c 
Out[22]: [[3], [6], [9]]


Let us take i=0 and print a[0]:

Out[23]: [1]


Hence what you are calculating is [1] - [4] + [7] instead you should be calculating 1 - 4 + 7. To do this change the line with error to:

x.append((a[i][0] - b[i][0] + c[i][0]))