Search code examples
c#deedle

How to merge multiple Deedle Series into 1 big series?


Having 3 Series<DateTime, double> srsA, srsB, srsC,

How do I merge them into one series srsAll ?

(Seems like the only way to merge is to construct multiple dataframes ?)


Solution

  • If you have three series, you can merge them using the Merge method:

    var srsAll = srsA.Merge(srsB).Merge(srsC);
    

    If by merging, you mean simply collect observations from all the individual series into one, then this is what you need. One caveat is that this does not allow duplicate keys, so if you have duplicate keys, you need to think what you want to do in this case. Deedle has more options, documented in the Series module documentation (this is F#-centric, but the same methods exist for C# use too).