'int' object is not iterable using panda python Here I want to calculate time interval in between row by row in time column import from csv file. my start time 6.00 a.m and my end time is next day 6.00 a.m. In between this time periods how to find time interval period. Can anyone help me to solve this problem?
Here I upload my code and csv file.

def time_diff(start, end):
start.append(pd.to_datetime(data['time'][0],formt = '%H:%M:%S').time())
end.append(pd.to_datetime(len(data['time']), format='%H:%M:%S').time())
if isinstance(start, datetime_time): # convert to datetime
    assert isinstance(end, datetime_time)
    start, end = [datetime.combine(datetime.min,i) for t in [start, end]]
if start &lt;= end: 
    return end - start
else: # end &lt; start 
    end += timedelta(1) # +day
    assert end &gt; start
    return end - start
for time_range in range (len(data['time'])):
start = [datetime.strptime(t,'%H:%M:%S') for t in time_range]
end = [datetime.strptime(t,'%H:%M:%S') for t in time_range]
print(time_diff(s, e))
assert time_diff(s, e) == time_diff(s.time(), e.time())


my csv file :-


  


I got an error:-

TypeError                                 Traceback (most recent call last)
 &lt;ipython-input-28-be40ae41d284&gt; in &lt;module&gt;()
 12         return end - start
 13 for time_range in range (len(data['time'])):
 ---&gt; 14     start = [datetime.strptime(t,'%H:%M:%S') for t in time_range]
 15     end = [datetime.strptime(t,'%H:%M:%S') for t in time_range]
 16     print(time_diff(s, e))

 TypeError: 'int' object is not iterable
for time_range in range (len(data['time'])):
start = [datetime.strptime(t,'%H:%M:%S') for t in time_range]


time_range is an integer due to using range(int). There is nothing to iterate using an int. It is not a container.