title: Handle datetime
body: <p>I've imported datetime in python but can't select a part of them with a for loop.
  I used pandas to import a txt file and now I would like to save part of this file in a new variable.</p>
  <pre><code>date_time= pd.concat((pd.to_datetime(test2018[0]), pd.to_datetime(test2019[0])))
  pos= np.concatenate((np.where(data_t == &quot;13-11-2019 00:00&quot;), np.where(data_t == &quot;16-12-2019 00:00&quot;)))
  lun1 = (pos[1, 0]-pos[0, 0])
  assex1 = pd.DataFrame(np.zeros((0, lun1)))
  for ond in range(pos[0, 0], pos[1, 0], 1):
    assex1[j] = (date_time[ond])
    assey1[j] = Y[ond]
  </code></pre>
  <p>the variable date_time is a timestamp as follows:</p>
  <p>(0, Timestamp ('2018-01-01 00:00:00')) (1, Timestamp ('2018-01-01 00:30:00')) (2, Timestamp ('2018-01-01 01 : 00: 00 ')) (3, Timestamp (' 2018-01-01 01:30:00 ')) (4, Timestamp (' 2018-01-01 02:00:00 ')) (5, Timestamp ( '2018-01-01 02:30:00')) ...</p>
  <p>while Y is a &quot;ndarray&quot;:
  Y= [0.76 0.75 0.76 0.76 0.75 0.74 0.74 0.75 0.77 0.74 0.74 0.75 0.75 0.76, 0.75 0.75 0.75 0.75 0.76 0.75 0.74 0.73 0.72 0.72 0.71 0.71 0.71 0.72, 0.73 0.74 0.72 0.71 0.72 0.72 0.72 0.72 0.74 0.72 0.73 0.74 0.72 0.72, 0.72 0.73 0.72 0.72 0.74 0.73 0.72 0.73 0.73 0.73 0.74 0.73 0.73 0.73, ...]</p>
  <p>The for loop does not work.
  I don't know how to set a null timestamp and then insert the values in the loop, or if there is a faster way can you tell me?
  Thanks a lot</p>