fslaborg / Deedle

Easy to use .NET library for data and time series manipulation and for scientific programming
http://fslab.org/Deedle/
BSD 2-Clause "Simplified" License
929 stars 196 forks source link

weird zip vs zipinner semantics #336

Open adamklein opened 8 years ago

adamklein commented 8 years ago

I noticed that Zip returns a series of opt 'T * opt 'T, whereas ZipInner returns series of 'T * 'T. Besides API confusion, I think the result is unintuitive:

var f = Deedle.Frame.FromRecords(
    new [] {
        new { b = 1.0, c = 5.0 },
        new { b = 2.0, c = Double.NaN },
        new { b = 3.0, c = 7.0 }
    });

f.GetColumn<double>("b")
    .ZipInner(f.GetColumn<double>("c"))
    .SelectValues(t => Double.IsNaN(t.Item2))
    .Format().Dump();

==>

0 -> False     
1 -> <missing> 
2 -> False