BlueMountainCapital/FSharp.DataFrame — pull request #40 by buybackoff (2013-10-11 11:57:00+00:00)
Title: Added zipInto and zipAlignInto for Series and Frame (+one bug fix)

Added `zipInto` and `zipAlignInto` for Series and Frame with tests, plus one bug fix (same as issue #30 but for series)

The start of the discussion is here: https://github.com/BlueMountainCapital/FSharp.DataFrame/pull/32#issuecomment-26060404

I think the name of these functions should be `zipInto` and `zipAlignInto` to avoid confusion with Join/Align methods in the Frame type. First, we keep `Into` convention. Second, `Join` and `Align` have special meaning in the Frame type - they are used to put two frames together side by side, so that the new frame will be wider/taller with previous values after these operations, while 'Zip' merges frames by row and column keys and produces a new frame with is generally narrower and shorter and with transformed values.

`ZipInto` operation *on series* makes one series from two and it is very similar to the LINQ Join method as well as to the LINQ Zip method - join and zip here are very close in meaning. `ZipInto` operation *on frames* takes only columns with same names and applies `Series.zipInto` on each pair of matching columns. `ZipAlignInto` operation on frames is a combination of `ZipInto` and `Align`: it seeks matching column names, applies `Series.zipAlignInto` on each matching series pair and keeps all or some non-matched series untouched (depending on JoinKind for columns).

I have added a number of tests for these functions on series and frames. For frames the tests show a real use case (how to calculate enterprise value for fake companies) and could be a starting point for documentation. I am glad to write documentation on these function after we agree on naming, method signatures, etc.