title: Iterate through list and compare values
body: <p>im trying to iterate through a column filled with lists of dates and say if the second date is 10 mins or more than the first date then '1' else '0' and if third date 10 mins or greater than second date then '1' else '0' ect ect.</p>
  <p>Im sorry if this has been answered i just cant seem to find any help with this.</p>
  <p>Lists are all different sizes. Does anyone know where how i should go about doing something like this?</p>
  <pre><code>df = df_data_collective.groupBy(&quot;customer_id&quot;).agg(
      F.expr(&quot;collect_list(start_dt)&quot;).alias(&quot;start_times&quot;)
  )
  </code></pre>
  <p>This outputs the customer id and lists of datetimes likes this</p>
  <pre><code>['2020-04-02T08:15:50+01:00', '2020-04-02T08:15:53+01:00', '2020-04-02T08:15:56+01:00', '2020-04-02T08:16:01+01:00', '2020-04-02T08:16:07+01:00', '2020-04-02T08:21:05+01:00', '2020-04-02T08:21:17+01:00', '2020-04-02T08:21:30+01:00', '2020-04-02T08:21:43+01:00', '2020-04-02T08:21:49+01:00', '2020-04-02T08:22:11+01:00', '2020-04-02T08:22:16+01:00', '2020-04-02T08:24:02+01:00', '2020-04-02T08:24:09+01:00', '2020-04-02T08:24:37+01:00', '2020-04-02T08:36:26+01:00', '2020-04-02T08:39:25+01:00', '2020-04-02T08:39:41+01:00', '2020-04-02T08:39:52+01:00', '2020-04-02T08:40:18+01:00', '2020-04-02T08:40:27+01:00', '2020-04-02T08:40:33+01:00', '2020-04-02T08:40:49+01:00', '2020-04-02T08:41:03+01:00', '2020-04-02T08:41:29+01:00', '2020-04-02T08:42:00+01:00', '2020-04-02T08:42:23+01:00', '2020-04-02T08:42:57+01:00', '2020-04-02T08:44:43+01:00', '2020-04-02T08:44:49+01:00']
  </code></pre>
  <p>I have a very basic knowledge of for loops however still in training and looking to see if anyone can offer any advice?</p>