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

Frame.Where loses column names if no rows returned #338

Closed adamklein closed 5 years ago

adamklein commented 8 years ago

This returns a frame without columns:

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.Where(_ => false).Format().Dump();

This is different than the F# filterRowValues function. The C# version is :

frame.Rows.Where(condition) |> FrameUtils.fromRows frame.IndexBuilder frame.VectorBuilder

We should change to mimic the F# version by using FrameUtils.fromRowsAndColumnKeys