Manipulation methods reshape, re-index, or transform a sequence without leaving the C# analytics pipeline.
In the C# API, analytics operate on
Sequencevalues obtained fromOrderedSequence<T>searches, direct ordered-sequence iteration,UnorderedSequence<T>.All, or positional projections such asquote.Close[dayRange].For an overview see page The C# Sequence Class
Operations
source.Unique()Removes repeated adjacent values.source.Normalize()Normalizes the sequence by its Euclidean length.source.Thin(ulong origin, ulong step)Keeps everystep-th value starting fromorigin.source.Subseq(ulong from, ulong till)Returns a subsequence between two positions, forward or backward.source.Reverse()Reverses the element order.source.Diff()Returns pairwise differences between adjacent values.source.Trend()Returns the trend sequence.source.Repeat(int count)Repeats each element a fixed number of times.source.Map(Sequence positions)Projects values at the specified positions.source.stretch(Sequence ts1, Sequence ts2, object filler)Stretches a sequence to the timestamps ints1using values fromts2.source.Stretch0(Sequence ts1, Sequence ts2, object filler)Stretch variant with zero-fill semantics.source.AsofJoin(Sequence ts1, Sequence ts2)Performs an as-of join on timestamp sequences.source.Cast(Type elemType)source.Cross(int firstCrossDirection)Returns the positions of crossings.source.Extrema(int firstExtremum)Returns local extrema positions.source.Hash()Calculates element hashes.source.Hash(Sequence other)Calculates combined hashes against another sequence.Example
This example extracts a subsequence from an ordered day sequence and projects aligned values from the related high-price sequence.
ulong count = quote.Day.Count; using (Sequence daySlice = quote.Day.Subseq(1, count - 2)) using (Sequence highSlice = quote.High[daySlice]) { while (daySlice.Next(out uint day) && highSlice.Next(out float high)) { printf("%s[%u]: %f\n", __arglist(quote.Symbol, day, (double)high)); } }