title: How to compare SRT file timestamps in pandas?
body: <p><s>I'm trying to compare Start_Time column and End_Time column that are in <a href="https://i.stack.imgur.com/HApMQ.png" rel="nofollow noreferrer">SRT timestamp format</a>: 00:00:00,230</s></p>
  <p>I used to_datetime to compare and created a new column to keep track of the difference between the end and start times. Check the answer for more info.</p>
  <pre><code>t1 = df['Start_Time']
  t2 = df['End_Time']
  diff = (t1-t2).astype('timedelta64[s]')  
  
  df['Start_Time'] = pd.to_datetime(df['Start_Time'])
  df['End_Time'] = pd.to_datetime(df['End_Time'])
  </code></pre>
  <p>But when I run the code above, it tells me this:</p>
  <pre><code>TypeError: Cannot convert input [1      00:00:00,230 ... end of list] Name: Start_Time, Length: 123, dtype: object] of type &lt;class 'pandas.core.series.Series'&gt; to Timestamp
  </code></pre>
  <p><strong>Is there a way to compare the two columns while keeping the SRT formatting?</strong></p>
  <p>My end goal is this logic:</p>
  <ul>
  <li>while a row does not appear on the screen for at least 5s</li>
  <li>checkTime</li>
  <li>add text from the next row to current row AND replace current End_Time with next row End_Time</li>
  <li>delete next row</li>
  <li>checkTime again</li>
  </ul>
  <p>PS:</p>
  <ol>
  <li>Still not entirely sure how to add next row column value to current column value (so adding row 3 of Text column to row 2 of Text column with a space between them).</li>
  <li>I think I can use loc to set current row at End_Time equal to the next row End_Time to replace the end timestamp but correct me if I'm wrong.</li>
  </ol>