   &gt;&gt;&gt; df = pd.DataFrame({&#39;vals0&#39;:vals0,&#39;vals1&#39;:vals1,&#39;vals2&#39;:vals2},index = ndx)</span>
<span class="sd">    &gt;&gt;&gt; out = gap_size(df)</span>
<span class="sd">    &gt;&gt;&gt; print(df)</span>
<span class="sd">                             vals0  vals1  vals2</span>
<span class="sd">    2017-01-01 12:00:00    NaN    0.0    0.0</span>
<span class="sd">    2017-01-01 12:15:00    NaN    1.0    1.0</span>
<span class="sd">    2017-01-01 12:30:00    NaN    NaN    2.0</span>