title: How to save dataframe to dictionary of different length
body: <p>So I have a data frame that looks like this</p>
  <pre><code>2018-01-01 00:00:00    False
  2018-01-01 00:30:00    False
  2018-01-01 01:00:00    False
  2018-01-01 01:30:00    True
  2018-01-01 02:00:00    True
  2018-01-01 02:30:00    True
  2018-01-01 03:00:00    False
  2018-01-01 03:30:00    False
  2018-01-01 04:00:00    True
  2018-01-01 04:30:00    True
  </code></pre>
  <p>and it would continue for a full year. I want to save each chunk that are true to a dictionary, so it would look something like this</p>
  <pre><code> dict{'0': [2018-01-01 01:30:00, 2018-01-01 02:00:00, 2018-01-01 02:30:00],
        '1': [2018-01-01 04:00:00, 2018-01-01 04:30:00]}
  </code></pre>
  <p>So I'm don't know how many times throughout the year the value is true continuously. But every time it's true, I want to create a new key in my dictionary and record the time at which the value is true.</p>
  <p>What would be the best way to approach that? I've thought about looping through the data frame and record the indices where it's true but that seems cumbersome. Any advice would be appreciated.</p>