title: How do I iterate over a Deedle Series<DateTime,Series<DateTime,ObjectSeries<string>>
body: <p>I have created a data frame using</p>
  
  <pre><code>// Create a dataframe containing the Open, High, Low, and Close
  let ohlc =
  cl 
  |&gt; Frame.sliceCols ["Open"; "High"; "Low"; "Close"; "Volume"]
  </code></pre>
  
  <p>with the resulting output:
                                Open  High  Low   Close Volume 
      12/28/2014 8:00:00 PM  -> 62.13 62.67 62.13 62.27 3206<br>
      12/28/2014 9:00:00 PM  -> 62.27 62.42 62.14 62.39 1620<br>
      12/28/2014 10:00:00 PM -> 62.4  62.41 62.16 62.21 1275<br>
      12/28/2014 11:00:00 PM -> 62.21 62.32 61.96 62.19 2791<br>
      12/29/2014 12:00:00 AM -> 62.17 62.25 62.08 62.23 1233<br>
      12/29/2014 1:00:00 AM  -> 62.23 62.41 62.21 62.31 1186<br>
      12/29/2014 2:00:00 AM  -> 62.32 62.32 62.07 62.21 1446<br>
      12/29/2014 3:00:00 AM  -> 62.22 62.35 62.17 62.28 1335   </p>
  
  <p>I now want to generate a higher time frame (daily) from the above hourly sample.</p>
  
  <p>I start off with:</p>
  
  <pre><code>ohlc
  |&gt; Frame.rows
  |&gt; Series.resampleEquiv (fun d -&gt; d.Date)
  </code></pre>
  
  <p>which returns: 
      <code>Series&lt;DateTime,Series&lt;DateTime,ObjectSeries&lt;string&gt;&gt;&gt;.</code> </p>
  
  <p>I want to create a new DataFrame containing the columns Date(key), Open, High, Low, Close and Volume.   Open is the 1st open in row 1 of the series. High is the Max High in the series.  Low is the Min Low in the series.  Close is the last Close in the series.  Volume is the sum of Volume in the series</p>
  
  <p>So something like:</p>
  
  <pre><code>ohlc
  |&gt; Frame.rows
  |&gt; Series.resampleEquiv (fun d -&gt; d.Date)
  |&gt; ??
  |&gt; ??
  </code></pre>
  
  <p>Instead of trying to do this at the Frame level using Rows, would I be better off trying do this with Frame using Columns?</p>
  
  <p>UPDATE
  Here is the finished code:</p>
  
  <pre><code>ohlc
  |&gt; Frame.rows
  |&gt; Series.resampleEquiv (fun d -&gt; d.Date)
  |&gt; Series.mapValues (fun s -&gt;
     let temp = Frame.ofRows s 
     series ["Open"  =&gt; Series.firstValue temp?Open
             "High"  =&gt; defaultArg (Stats.max temp?High) nan
             "Low"   =&gt; defaultArg (Stats.min temp?Low) nan
             "Close" =&gt; Series.lastValue temp?Close 
             "Volume" =&gt; defaultArg (Some( Stats.sum temp?Volume) ) nan ] )
  |&gt; Frame.ofRows
  </code></pre>
  
  <p>I was not able to use:</p>
  
  <pre><code>"Volume" =&gt; defaultArg (Stats.sum temp?Volume) nan ] )
  </code></pre>
  
  <p>as this gave me an error message: This expression was expected to have type float option but here has type float.  I had to wrap the function Some().  Not sure why Stats.sum requires this but Stat.max and Stats.min do not.</p>