Assume I have a dataset with three inputs:
x1 x2 x3 0 a b c 1 d e f 2 g h i 3 j k l 4 m n o 5 p q r 6 s t u : :
0,1,2,3 are times, x1, x2, x3 are inputs that are measured. So here x1 inputs are measured at every one hour. x2 and x3 will be measured at different time. What I need to do , I want write that what ever the measured in x1, x2, x3 it will add and subtract the values are equal to the x1 input next time value So here what I want to do is:
x1 x2 x3 y 0 a b c a+b-c==d 1 d e f d+e+f==g 2 g h i g+h-i==j 3 j k l j+k-l==m 4 m n o m+n-o==p 5 p q r p+q-r==s 6 s t u s+t-u==v : :
I tried shift method and it didn't work for me what I want exactly. I tried another method and it worked, but didn't came as I want. Here I upload the code.
Code : data = pd.read_csv('data6.csv') i=0 j=1 while j < len(data): j=data['x1'][i] - data['x2'][i] + data['x3'][i] i+=1 j!=i print(j)
This is works , but it is just showing only one data
In my csv file this is second input value of x1 input. I want to write this code contonously happened and read the value as I shown above. Can anyone help me to solve this problem?