18 using System.Collections.Generic;
42 return input.SelectValues(current =>
44 var sum = prev + current;
65 return input.SelectValues(current =>
67 var product = prev * current;
86 var prevMax =
double.NegativeInfinity;
87 var values =
new List<double>();
89 foreach (var point
in input.Values)
115 var inputShifted = input.Shift(1);
117 return (input - inputShifted) / inputShifted;
132 return (input.PercentChange()
133 .Where(kvp => !
double.IsInfinity(kvp.Value)) + 1)
134 .CumulativeProduct() - 1;
144 var returns = input.CumulativeReturns();
151 return returns.LastValue();
164 var newFrame = frame.Clone();
166 foreach (var key
in frame.ColumnKeys)
168 if (newFrame[key].DropMissing().ValueCount == 0)
170 newFrame.DropColumn(key);
187 if (frame.ColumnKeys.Count() == 0)
189 return Frame.CreateEmpty<TRowKey, TColumnKey>();
192 var newFrame = frame.Clone().Transpose();
194 foreach (var key
in frame.RowKeys)
196 if (newFrame[key].DropMissing().ValueCount == 0)
198 newFrame.DropColumn(key);
202 return newFrame.Transpose();