find the difference between two columns in specific rows I have the following columns from one data frame

 0         1585742136995  
 1         1585742137014
 2         1585742137035
 3         1585742137058
 4         1585742137080
          ...      
 177809    1585570661653
 177810    1585570661675
 177811    1585570661686
 177812    1585570661709
 177813    1585570661731


Name: acctimestamp, Length: 177814, dtype: int64>

and

0         1585742136982
1         1585742136996
2         1585742137015
3         1585742137036
4         1585742137058
          ...      
177809    1585570661632
177810    1585570661653
177811    1585570661676
177812    1585570661698
177813    1585570661710
Name: gyrtimestamp, Length: 177814, dtype: int64&gt;


I want to start from 299 row and by 200 rows to find and print the difference between two columns (acctimestamp, gyrtimestamp)

so let's say at 299+200=499 row what is the difference between the 2 columns. After that what is the difference in 699 row And I want to do this for all the len of the data frame.

I am facing difficulties with the for loop can you help me a little bit?
how a loop like this would be?

i write this df['diff'] = df['acctimestamp'] - df['gyrtimestamp'] but it only show me the difference line by line

how to start from 499 row print the difference and print every 200 row?

i try this code:

for i in range (len(df)):
   i=200
   df1=df.loc[299+i, "acctimestamp" ]-df.loc[299+i, "gyrtimestamp"]


but the counter print the difference in line 499 and do not continue all the way to the end of the data frame
for i in range (99,len(df),200):
    try:
       df1=df.loc[i+200,'acctimestamp'] - df.loc[i+200,'gyrtimestamp']
       print(df1)
    except: 
       print('End')


Is what you're looking for? Step is 200. So i will take 299 -> 499 -> 699 etc.., and you're taking only the rows between i ( 299 ) and i + 200 ( 499 ) and so on.