Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Series<IndexT, ValueT>

Class that represents a series containing a sequence of indexed values.

Type parameters

  • IndexT

  • ValueT

Hierarchy

Implements

Index

Constructors

constructor

  • Create a series.

    example
    
    const series = new Series();
    
    example
    
    const series = new Series([10, 20, 30, 40]);
    
    example
    
    const series = new Series({ index: [1, 2, 3, 4], values: [10, 20, 30, 40]});
    
    example
    
    const lazyInit = () => ({ index: [1, 2, 3, 4], values: [10, 20, 30, 40] });
    const series = new Series(lazyInit);
    

    Parameters

    • Optional config: Iterable<ValueT> | ISeriesConfig<IndexT, ValueT> | SeriesConfigFn<IndexT, ValueT>

      This can be an array, a configuration object or a function that lazily produces a configuration object.

      It can be an array that specifies the values that the series contains.

      It can be a ISeriesConfig that defines the values and configuration of the series.

      Or it can be a function that lazily produces a ISeriesConfig.

    Returns Series

Methods

__@iterator

  • __@iterator(): Iterator<ValueT>
  • Get an iterator to enumerate the values of the series. Enumerating the iterator forces lazy evaluation to complete. This function is automatically called by for...of.

    example
    
    for (const value of series) {
        // ... do something with the value ...
    }
    

    Returns Iterator<ValueT>

    An iterator for the series.

after

  • after(indexValue: IndexT): ISeries<IndexT, ValueT>
  • Gets a new series containing all values after the specified index value (exclusive).

    example
    
    const series = new Series({
         index: [0, 1, 2, 3], // This is the default index.
         values: [10, 20, 30, 40],
    });
    
    const lastHalf = df.before(1);
    expect(lastHalf.toArray()).to.eql([30, 40]);
    
    example
    
    const timeSerie = ... a series indexed by date/time ...
    
    // Get all values after the specified date.
    const result = timeSeries.after(new Date(2016, 5, 4));
    

    Parameters

    • indexValue: IndexT

      The index value after which to start the new series.

    Returns ISeries<IndexT, ValueT>

    Returns a new series containing all values after the specified index value.

aggregate

  • Aggregate the values in the series to a single result.

    example
    
    const dailySales = ... daily sales figures for the past month ...
    const totalSalesForthisMonth = dailySales.aggregate(
         0, // Seed - the starting value.
         (accumulator, salesAmount) => accumulator + salesAmount // Aggregation function.
    );
    
    example
    
    const totalSalesAllTime = 500; // We'll seed the aggregation with this value.
    const dailySales = ... daily sales figures for the past month ...
    const updatedTotalSalesAllTime = dailySales.aggregate(
         totalSalesAllTime,
         (accumulator, salesAmount) => accumulator + salesAmount
    );
    
    example
    
    var salesDataSummary = salesData.aggregate({
         TotalSales: series => series.count(),
         AveragePrice: series => series.average(),
         TotalRevenue: series => series.sum(),
    });
    

    Type parameters

    • ToT

    Parameters

    • seedOrSelector: AggregateFn<ValueT, ToT> | ToT
    • Optional selector: AggregateFn<ValueT, ToT>

      Function that takes the seed and then each value in the series and produces the aggregated value.

    Returns ToT

    Returns a new value that has been aggregated from the series using the 'selector' function.

all

  • Evaluates a predicate function for every value in the series to determine if some condition is true/truthy for all values in the series.

    example
    
    const result = series.all(salesFigure => salesFigure > 100); // Returns true if all sales figures are greater than 100.
    

    Parameters

    • predicate: PredicateFn<ValueT>

      Predicate function that receives each value. It should returns true/truthy for a match, otherwise false/falsy.

    Returns boolean

    Returns true if the predicate has returned true or truthy for every value in the series, otherwise returns false. Returns false for an empty series.

amountChange

  • amountChange(period?: undefined | number): ISeries<IndexT, number>
  • Compute the amount of change between pairs or sets of values in the series.

    example
    
    const saleFigures = ... running series of daily sales figures ...
    const amountChanged = salesFigures.amountChanged(); // Amount that sales has changed, day to day.
    
    example
    
    const saleFigures = ... running series of daily sales figures ...
    const amountChanged = salesFigures.amountChanged(7); // Amount that sales has changed, week to week.
    

    Parameters

    • Optional period: undefined | number

    Returns ISeries<IndexT, number>

    Returns a new series where each value indicates the amount of change from the previous number value in the original series.

any

  • Evaluates a predicate function for every value in the series to determine if some condition is true/truthy for any of values in the series.

    If no predicate is specified then it simply checks if the series contains more than zero values.

    example
    
    const result = series.any(salesFigure => salesFigure > 100); // Do we have any sales figures greater than 100?
    
    example
    
    const result = series.any(); // Do we have any sales figures at all?
    

    Parameters

    Returns boolean

    Returns true if the predicate has returned truthy for any value in the series, otherwise returns false. If no predicate is passed it returns true if the series contains any values at all. Returns false for an empty series.

appendPair

  • appendPair(pair: [IndexT, ValueT]): ISeries<IndexT, ValueT>
  • Append a pair to the end of a series. Doesn't modify the original series! The returned series is entirely new and contains values from the original series plus the appended pair.

    example
    
    const newIndex = ... index of the new row ...
    const newRow = ... the new data row to append ...
    const appendedSeries = series.appendPair([newIndex, newRows]);
    

    Parameters

    • pair: [IndexT, ValueT]

      The index/value pair to append.

    Returns ISeries<IndexT, ValueT>

    Returns a new series with the specified pair appended.

at

  • at(index: IndexT): ValueT | undefined
  • Get the value, if there is one, with the specified index.

    example
    
    const value = series.at(5); // Get the value at index 5 (with a default 0-based index).
    
    example
    
    const date = ... some date ...
    // Retreive the value with specified date from a time-series (assuming date indexed has been applied).
    const value = series.at(date);
    

    Parameters

    • index: IndexT

      Index to for which to retreive the value.

    Returns ValueT | undefined

    Returns the value from the specified index in the series or undefined if there is no such index in the present in the series.

average

  • average(): number
  • Average the values in a series and returns the result

    example
    
    const averageSales = salesFigures.average();
    

    Returns number

    Returns the average of the number values in the series.

bake

  • Forces lazy evaluation to complete and 'bakes' the series into memory.

    example
    
    const baked = series.bake();
    

    Returns ISeries<IndexT, ValueT>

    Returns a series that has been 'baked', all lazy evaluation has completed.

before

  • before(indexValue: IndexT): ISeries<IndexT, ValueT>
  • Gets a new series containing all values up to the specified index value (exclusive).

    example
    
    const series = new Series({
         index: [0, 1, 2, 3], // This is the default index.
         values: [10, 20, 30, 40],
    });
    
    const firstHalf = series.before(2);
    expect(firstHalf.toArray()).to.eql([10, 20]);
    
    example
    
    const timeSeries = ... a series indexed by date/time ...
    
    // Get all values before the specified date.
    const result = timeSeries.before(new Date(2016, 5, 4));
    

    Parameters

    • indexValue: IndexT

      The index value at which to end the new series.

    Returns ISeries<IndexT, ValueT>

    Returns a new series containing all values up to (but not including) the specified index value.

between

  • between(startIndexValue: IndexT, endIndexValue: IndexT): ISeries<IndexT, ValueT>
  • Gets a new series containing all values between the specified index values (inclusive).

    example
    
    const series = new Series({
         index: [0, 1, 2, 3, 4, 6], // This is the default index.
         values: [10, 20, 30, 40, 50, 60],
    });
    
    const middleSection = series.between(1, 4);
    expect(middleSection.toArray()).to.eql([20, 30, 40, 50]);
    
    example
    
    const timeSeries = ... a series indexed by date/time ...
    
    // Get all values between the start and end dates (inclusive).
    const result = timeSeries.after(new Date(2016, 5, 4), new Date(2016, 5, 22));
    

    Parameters

    • startIndexValue: IndexT

      The index at which to start the new series.

    • endIndexValue: IndexT

      The index at which to end the new series.

    Returns ISeries<IndexT, ValueT>

    Returns a new series containing all values between the specified index values (inclusive).

bucket

  • Organise all values in the series into the specified number of buckets. Assumes that the series is a series of numbers.

    example
    
    const buckets = series.bucket(20); // Distribute values into 20 evenly spaced buckets.
    console.log(buckets.toString());
    

    Parameters

    • numBuckets: number

      The number of buckets to create.

    Returns IDataFrame<IndexT, IBucket>

    Returns a dataframe containing bucketed values. The input values are divided up into these buckets.

cast

  • cast<NewValueT>(): ISeries<IndexT, NewValueT>
  • Cast the value of the series to a new type. This operation has no effect but to retype the values that the series contains.

    example
    
    const castSeries = series.cast();
    

    Type parameters

    • NewValueT

    Returns ISeries<IndexT, NewValueT>

    The same series, but with the type changed.

concat

  • Concatenate multiple other series onto this series.

    example
    
    const concatenated = a.concat(b);
    
    example
    
    const concatenated = a.concat(b, c);
    
    example
    
    const concatenated = a.concat([b, c]);
    
    example
    
    const concatenated = a.concat(b, [c, d]);
    
    example
    
    const otherSeries = [... array of series...];
    const concatenated = a.concat(otherSeries);
    

    Parameters

    • Rest ...series: (ISeries<IndexT, ValueT> | ISeries<IndexT, ValueT>[])[]

      Multiple arguments. Each can be either a series or an array of series.

    Returns ISeries<IndexT, ValueT>

    Returns a single series concatenated from multiple input series.

count

  • count(): number
  • Count the number of values in the seriese

    example
    
    const numValues = series.count();
    

    Returns number

    Returns the count of all values.

counter

  • Counts the number of sequential values where the predicate evaluates to truthy. Outputs 0 for values when the predicate evaluates to falsy.

    example
    
    const series = new Series([ 1, 10, 3, 15, 8, 5 ]);
    const counted = series.counter(value => value >= 3);
    console.log(counted.toString());
    

    Parameters

    • predicate: PredicateFn<ValueT>

      User-defined function. Should evaluate to truthy to activate the counter or falsy to deactivate it.

    Returns ISeries<IndexT, number>

    Returns a new series that counts up the number of sequential values where the predicate evaluates to truthy. 0 values appear when the prediate evaluates to falsy.

defaultIfEmpty

  • defaultIfEmpty(defaultSequence: ValueT[] | ISeries<IndexT, ValueT>): ISeries<IndexT, ValueT>
  • Returns the specified default series if the input series is empty.

    example
    
    const emptySeries = new Series();
    const defaultSeries = new Series([ 1, 2, 3 ]);
    expect(emptyDataFrame.defaultIfEmpty(defaultSeries)).to.eql(defaultSeries);
    
    example
    
    const nonEmptySeries = new Series([ 100 ]);
    const defaultSeries = new Series([ 1, 2, 3 ]);
    expect(nonEmptySeries.defaultIfEmpty(defaultSeries)).to.eql(nonEmptySeries);
    

    Parameters

    • defaultSequence: ValueT[] | ISeries<IndexT, ValueT>

      Default series to return if the input series is empty.

    Returns ISeries<IndexT, ValueT>

    Returns 'defaultSequence' if the input series is empty.

detectTypes

  • detectTypes(): IDataFrame<number, ITypeFrequency>
  • Detect the the frequency of the types of the values in the series. This is a good way to understand the shape of your data.

    example
    
    const dataTypes = series.detectTypes();
    console.log(dataTypes.toString());
    

    Returns IDataFrame<number, ITypeFrequency>

    Returns a DataFrame with rows that confirm to ITypeFrequency that describes the data types contained in the original series.

detectValues

  • detectValues(): IDataFrame<number, IValueFrequency>
  • Detect the frequency of the values in the series. This is a good way to understand the shape of your data.

    example
    
    const dataValues = series.detectValues();
    console.log(dataValues.toString());
    

    Returns IDataFrame<number, IValueFrequency>

    Returns a DataFrame with rows that conform to IValueFrequency that describes the values contained in the original series.

distinct

  • Returns only the set of values in the series that are distinct. Provide a user-defined selector to specify criteria for determining the distinctness. This can be used to remove duplicate values from the series.

    example
    
    const uniqueValues = series.distinct(); // Get only non-duplicated value in the series.
    
    example
    
    const bucketedValues = series.distinct(value => Math.floor(value / 10)); // Lump values into buckets of 10.
    

    Type parameters

    • ToT

    Parameters

    Returns ISeries<IndexT, ValueT>

    Returns a series containing only unique values in the series.

endAt

  • endAt(indexValue: IndexT): ISeries<IndexT, ValueT>
  • Gets a new series containing all values up until and including the specified index value (inclusive).

    example
    
    const series = new Series({
         index: [0, 1, 2, 3], // This is the default index.
         values: [10, 20, 30, 40],
    });
    
    const firstHalf = series.endAt(1);
    expect(firstHalf.toArray()).to.eql([10, 20]);
    
    example
    
    const timeSeries = ... a series indexed by date/time ...
    
    // Get all values ending at a particular date.
    const result = timeSeries.endAt(new Date(2016, 5, 4));
    

    Parameters

    • indexValue: IndexT

      The index value at which to end the new series.

    Returns ISeries<IndexT, ValueT>

    Returns a new series containing all values up until and including the specified index value.

except

  • except<InnerIndexT, InnerValueT, KeyT>(inner: ISeries<InnerIndexT, InnerValueT>, outerSelector?: SelectorFn<ValueT, KeyT>, innerSelector?: SelectorFn<InnerValueT, KeyT>): ISeries<IndexT, ValueT>
  • Creates a new series by merging two input series. The resulting series contains only the values from the 1st series that don't appear in the 2nd series. This is essentially subtracting the values from the 2nd series from the 1st and creating a new series with the remaining values.

    example
    
    const seriesA = ...
    const seriesB = ...
    const remainingDf = seriesA.except(seriesB);
    
    example
    
    // Find the list of customers haven't bought anything recently.
    const allCustomers = ... list of all customers ...
    const recentCustomers = ... list of customers who have purchased recently ...
    const remainingCustomers = allCustomers.except(
         recentCustomers,
         customerRecord => customerRecord.CustomerId
    );
    

    Type parameters

    • InnerIndexT

    • InnerValueT

    • KeyT

    Parameters

    • inner: ISeries<InnerIndexT, InnerValueT>

      The inner series to merge (the series you call the function on is the 'outer' series).

    • Optional outerSelector: SelectorFn<ValueT, KeyT>
    • Optional innerSelector: SelectorFn<InnerValueT, KeyT>

    Returns ISeries<IndexT, ValueT>

    Returns a new series that contains only the values from the 1st series that don't appear in the 2nd series.

fillGaps

  • fillGaps(comparer: ComparerFn<[IndexT, ValueT], [IndexT, ValueT]>, generator: GapFillFn<[IndexT, ValueT], [IndexT, ValueT]>): ISeries<IndexT, ValueT>
  • Fill gaps in a series.

    example
    
      var sequenceWithGaps = ...
    
     // Predicate that determines if there is a gap.
     var gapExists = (pairA, pairB) => {
         // Returns true if there is a gap.
         return true;
     };
    
     // Generator function that produces new rows to fill the game.
     var gapFiller = (pairA, pairB) => {
         // Create an array of index, value pairs that fill the gaps between pairA and pairB.
         return [
             newPair1,
             newPair2,
             newPair3,
         ];
     };
    
     var sequenceWithoutGaps = sequenceWithGaps.fillGaps(gapExists, gapFiller);
    

    Parameters

    • comparer: ComparerFn<[IndexT, ValueT], [IndexT, ValueT]>

      User-defined comparer function that is passed pairA and pairB, two consecutive values, return truthy if there is a gap between the value, or falsey if there is no gap.

    • generator: GapFillFn<[IndexT, ValueT], [IndexT, ValueT]>

      User-defined generator function that is passed pairA and pairB, two consecutive values, returns an array of pairs that fills the gap between the values.

    Returns ISeries<IndexT, ValueT>

    Returns a new series with gaps filled in.

first

  • first(): ValueT
  • Get the first value of the series.

    example
    
    const firstValue = series.first();
    

    Returns ValueT

    Returns the first value of the series.

forEach

  • Invoke a callback function for each value in the series.

    example
    
    series.forEach(value => {
         // ... do something with the value ...
    });
    

    Parameters

    • callback: CallbackFn<ValueT>

      The calback function to invoke for each value.

    Returns ISeries<IndexT, ValueT>

    Returns the original series with no modifications.

getIndex

getTypeCode

  • getTypeCode(): string
  • Allows the series to be queried to confirm that it is actually a series. Used from JavaScript to tell the difference between a Series and a DataFrame.

    Returns string

    Returns the string "series".

groupBy

  • Collects values in the series into a new series of groups according to a user-defined selector function.

    example
    
    const sales = ... product sales ...
    const salesByProduct = sales.groupBy(sale => sale.ProductId);
    for (const productSalesGroup of salesByProduct) {
         // ... do something with each product group ...
         const productId = productSalesGroup.first().ProductId;
         const totalSalesForProduct = productSalesGroup.deflate(sale => sale.Amount).sum();
         console.log(totalSalesForProduct);
    }
    

    Type parameters

    • GroupT

    Parameters

    • selector: SelectorWithIndexFn<ValueT, GroupT>

      User-defined selector function that specifies the criteriay to group by.

    Returns ISeries<number, ISeries<IndexT, ValueT>>

    Returns a new series of groups. Each group is a series with values that have been grouped by the 'selector' function.

groupSequentialBy

  • Collects values in the series into a new series of groups based on if the values are the same or according to a user-defined selector function.

    example
    
    // Some ultra simple stock trading strategy backtesting...
    const dailyStockPrice = ... daily stock price for a company ...
    const priceGroups  = dailyStockPrice.groupBy(day => day.close > day.movingAverage);
    for (const priceGroup of priceGroups) {
         // ... do something with each stock price group ...
    
         const firstDay = priceGroup.first();
         if (firstDay.close > movingAverage) {
             // This group of days has the stock price above its moving average.
             // ... maybe enter a long trade here ...
         }
         else {
             // This group of days has the stock price below its moving average.
             // ... maybe enter a short trade here ...
         }
    }
    

    Type parameters

    • GroupT

    Parameters

    Returns ISeries<number, ISeries<IndexT, ValueT>>

    Returns a new series of groups. Each group is a series with values that are the same or have been grouped by the 'selector' function.

head

  • head(numValues: number): ISeries<IndexT, ValueT>
  • Get X value from the start of the series. Pass in a negative value to get all values at the head except for X values at the tail.

    examples
    
    const sample = series.head(10); // Take a sample of 10 values from the start of the series.
    

    Parameters

    • numValues: number

      Number of values to take.

    Returns ISeries<IndexT, ValueT>

    Returns a new series that has only the specified number of values taken from the start of the original series.

inflate

  • Converts (inflates) a series to a DataFrame.

    example
    
    const dataframe = series.inflate(); // Inflate a series of objects to a dataframe.
    
    example
    
    const dataframe = series.inflate(value => { AColumn:  value }); // Produces a dataframe with 1 column from a series of values.
    
    example
    
    const dataframe = series.inflate(value => { AColumn:  value.NestedValue }); // Extract a nested value and produce a dataframe from it.
    

    Type parameters

    • ToT

    Parameters

    Returns IDataFrame<IndexT, ToT>

    Returns a dataframe that was created from the original series.

insertPair

  • insertPair(pair: [IndexT, ValueT]): ISeries<IndexT, ValueT>
  • Insert a pair at the start of the series. Doesn't modify the original series! The returned series is entirely new and contains values from the original series plus the inserted pair.

    example
    
    const newIndex = ... index of the new row ...
    const newRow = ... the new data row to insert ...
    const insertedSeries = series.insertPair([newIndex, newRows]);
    

    Parameters

    • pair: [IndexT, ValueT]

      The index/value pair to insert.

    Returns ISeries<IndexT, ValueT>

    Returns a new series with the specified pair inserted.

intersection

  • intersection<InnerIndexT, InnerValueT, KeyT>(inner: ISeries<InnerIndexT, InnerValueT>, outerSelector?: SelectorFn<ValueT, KeyT>, innerSelector?: SelectorFn<InnerValueT, KeyT>): ISeries<IndexT, ValueT>
  • Creates a new series by merging two input series. The resulting series contains the intersection of values from the two input series. These are only the values that appear in both series.

    example
    
    const seriesA = ...
    const seriesB = ...
    const mergedDf = seriesA.intersection(seriesB);
    
    example
    
    // Merge two sets of customer records to find only the
    // customers that appears in both.
    const customerRecordsA = ...
    const customerRecordsB = ...
    const intersectionOfCustomerRecords = customerRecordsA.intersection(
         customerRecordsB,
         customerRecord => customerRecord.CustomerId
    );
    

    Type parameters

    • InnerIndexT

    • InnerValueT

    • KeyT

    Parameters

    • inner: ISeries<InnerIndexT, InnerValueT>

      The inner series to merge (the series you call the function on is the 'outer' series).

    • Optional outerSelector: SelectorFn<ValueT, KeyT>
    • Optional innerSelector: SelectorFn<InnerValueT, KeyT>

    Returns ISeries<IndexT, ValueT>

    Returns a new series that contains the intersection of values from the two input series.

invert

  • invert(): ISeries<IndexT, number>
  • Invert the sign of every number value in the series. This assumes that the input series contains numbers.

    example
    
    const inverted = series.invert();
    

    Returns ISeries<IndexT, number>

    Returns a new series with all number values inverted.

join

  • join<KeyT, InnerIndexT, InnerValueT, ResultValueT>(inner: ISeries<InnerIndexT, InnerValueT>, outerKeySelector: SelectorFn<ValueT, KeyT>, innerKeySelector: SelectorFn<InnerValueT, KeyT>, resultSelector: JoinFn<ValueT, InnerValueT, ResultValueT>): ISeries<number, ResultValueT>
  • Creates a new series by merging two input series. The resulting dataframe contains only those value that have matching keys in both input series.

    example
    
    // Join together two sets of customers to find those
    // that have bought both product A and product B.
    const customerWhoBoughtProductA = ...
    const customerWhoBoughtProductB = ...
    const customersWhoBoughtBothProductsDf = customerWhoBoughtProductA.join(
             customerWhoBoughtProductB,
             customerA => customerA.CustomerId, // Join key.
             customerB => customerB.CustomerId, // Join key.
             (customerA, customerB) => {
                 return {
                     // ... merge the results ...
                 };
             }
         );
    

    Type parameters

    • KeyT

    • InnerIndexT

    • InnerValueT

    • ResultValueT

    Parameters

    • inner: ISeries<InnerIndexT, InnerValueT>

      The 'inner' series to join (the series you are callling the function on is the 'outer' series).

    • outerKeySelector: SelectorFn<ValueT, KeyT>

      User-defined selector function that chooses the join key from the outer series.

    • innerKeySelector: SelectorFn<InnerValueT, KeyT>

      User-defined selector function that chooses the join key from the inner series.

    • resultSelector: JoinFn<ValueT, InnerValueT, ResultValueT>

      User-defined function that merges outer and inner values.

    Returns ISeries<number, ResultValueT>

    Returns the new merged series.

joinOuter

  • joinOuter<KeyT, InnerIndexT, InnerValueT, ResultValueT>(inner: ISeries<InnerIndexT, InnerValueT>, outerKeySelector: SelectorFn<ValueT, KeyT>, innerKeySelector: SelectorFn<InnerValueT, KeyT>, resultSelector: JoinFn<ValueT | null, InnerValueT | null, ResultValueT>): ISeries<number, ResultValueT>
  • Creates a new series by merging two input series. The resulting series contains only those values that are only present in or or the other of the series, not both.

    example
    
    // Join together two sets of customers to find those
    // that have bought either product A or product B, not not both.
    const customerWhoBoughtProductA = ...
    const customerWhoBoughtProductB = ...
    const customersWhoBoughtEitherProductButNotBothDf = customerWhoBoughtProductA.joinOuter(
             customerWhoBoughtProductB,
             customerA => customerA.CustomerId, // Join key.
             customerB => customerB.CustomerId, // Join key.
             (customerA, customerB) => {
                 return {
                     // ... merge the results ...
                 };
             }
         );
    

    Type parameters

    • KeyT

    • InnerIndexT

    • InnerValueT

    • ResultValueT

    Parameters

    • inner: ISeries<InnerIndexT, InnerValueT>

      The 'inner' series to join (the series you are callling the function on is the 'outer' series).

    • outerKeySelector: SelectorFn<ValueT, KeyT>

      User-defined selector function that chooses the join key from the outer series.

    • innerKeySelector: SelectorFn<InnerValueT, KeyT>

      User-defined selector function that chooses the join key from the inner series.

    • resultSelector: JoinFn<ValueT | null, InnerValueT | null, ResultValueT>

      User-defined function that merges outer and inner values.

      Implementation from here:

      http://blogs.geniuscode.net/RyanDHatch/?p=116
      

    Returns ISeries<number, ResultValueT>

    Returns the new merged series.

joinOuterLeft

  • joinOuterLeft<KeyT, InnerIndexT, InnerValueT, ResultValueT>(inner: ISeries<InnerIndexT, InnerValueT>, outerKeySelector: SelectorFn<ValueT, KeyT>, innerKeySelector: SelectorFn<InnerValueT, KeyT>, resultSelector: JoinFn<ValueT | null, InnerValueT | null, ResultValueT>): ISeries<number, ResultValueT>
  • Creates a new series by merging two input series. The resulting series contains only those values that are present either in both series or only in the outer (left) series.

    example
    
    // Join together two sets of customers to find those
    // that have bought either just product A or both product A and product B.
    const customerWhoBoughtProductA = ...
    const customerWhoBoughtProductB = ...
    const boughtJustAorAandB = customerWhoBoughtProductA.joinOuterLeft(
             customerWhoBoughtProductB,
             customerA => customerA.CustomerId, // Join key.
             customerB => customerB.CustomerId, // Join key.
             (customerA, customerB) => {
                 return {
                     // ... merge the results ...
                 };
             }
         );
    

    Type parameters

    • KeyT

    • InnerIndexT

    • InnerValueT

    • ResultValueT

    Parameters

    • inner: ISeries<InnerIndexT, InnerValueT>

      The 'inner' series to join (the series you are callling the function on is the 'outer' series).

    • outerKeySelector: SelectorFn<ValueT, KeyT>

      User-defined selector function that chooses the join key from the outer series.

    • innerKeySelector: SelectorFn<InnerValueT, KeyT>

      User-defined selector function that chooses the join key from the inner series.

    • resultSelector: JoinFn<ValueT | null, InnerValueT | null, ResultValueT>

      User-defined function that merges outer and inner values.

      Implementation from here:

      http://blogs.geniuscode.net/RyanDHatch/?p=116
      

    Returns ISeries<number, ResultValueT>

    Returns the new merged series.

joinOuterRight

  • joinOuterRight<KeyT, InnerIndexT, InnerValueT, ResultValueT>(inner: ISeries<InnerIndexT, InnerValueT>, outerKeySelector: SelectorFn<ValueT, KeyT>, innerKeySelector: SelectorFn<InnerValueT, KeyT>, resultSelector: JoinFn<ValueT | null, InnerValueT | null, ResultValueT>): ISeries<number, ResultValueT>
  • Creates a new series by merging two input series. The resulting series contains only those values that are present either in both series or only in the inner (right) series.

    example
    
    // Join together two sets of customers to find those
    // that have bought either just product B or both product A and product B.
    const customerWhoBoughtProductA = ...
    const customerWhoBoughtProductB = ...
    const boughtJustAorAandB = customerWhoBoughtProductA.joinOuterRight(
             customerWhoBoughtProductB,
             customerA => customerA.CustomerId, // Join key.
             customerB => customerB.CustomerId, // Join key.
             (customerA, customerB) => {
                 return {
                     // ... merge the results ...
                 };
             }
         );
    

    Type parameters

    • KeyT

    • InnerIndexT

    • InnerValueT

    • ResultValueT

    Parameters

    • inner: ISeries<InnerIndexT, InnerValueT>

      The 'inner' series to join (the series you are callling the function on is the 'outer' series).

    • outerKeySelector: SelectorFn<ValueT, KeyT>

      User-defined selector function that chooses the join key from the outer series.

    • innerKeySelector: SelectorFn<InnerValueT, KeyT>

      User-defined selector function that chooses the join key from the inner series.

    • resultSelector: JoinFn<ValueT | null, InnerValueT | null, ResultValueT>

      User-defined function that merges outer and inner values.

      Implementation from here:

      http://blogs.geniuscode.net/RyanDHatch/?p=116
      

    Returns ISeries<number, ResultValueT>

    Returns the new merged series.

last

  • last(): ValueT
  • Get the last value of the series.

    example
    
    const lastValue = series.last();
    

    Returns ValueT

    Returns the last value of the series.

max

  • max(): number
  • Get the max value in the series.

    example
    
    const maxSales = salesFigures.max();
    

    Returns number

    Returns the maximum of the number values in the series.

median

  • median(): number
  • Get the median value in the series. Note that this sorts the series, which can be expensive.

    example
    
    const medianSales = salesFigures.median();
    

    Returns number

    Returns the median of the values in the series.

min

  • min(): number
  • Get the min value in the series.

    example
    
    const minSales = salesFigures.min();
    

    Returns number

    Returns the minimum of the number values in the series.

none

  • Evaluates a predicate function for every value in the series to determine if some condition is true/truthy for none of values in the series.

    If no predicate is specified then it simply checks if the series contains zero values.

    example
    
    const result = series.none(salesFigure => salesFigure > 100); // Do we have zero sales figures greater than 100?
    
    example
    
    const result = series.none(); // Do we have zero sales figures?
    

    Parameters

    Returns boolean

    Returns true if the predicate has returned truthy for zero values in the series, otherwise returns false. Returns false for an empty series.

orderBy

  • Sorts the series in ascending order by a value defined by the user-defined selector function.

    example
    
    const orderedSeries = series.orderBy(value => value);
    
    example
    
    const orderedSeries = series.orderBy(value => value.NestedValue);
    

    Type parameters

    • SortT

    Parameters

    • selector: SelectorWithIndexFn<ValueT, SortT>

      User-defined selector function that selects the value to sort by.

    Returns IOrderedSeries<IndexT, ValueT, SortT>

    Returns a new series that has been ordered accorrding to the value chosen by the selector function.

orderByDescending

  • Sorts the series in descending order by a value defined by the user-defined selector function.

    example
    
    const orderedSeries = series.orderByDescending(value => value);
    
    example
    
    const orderedSeries = series.orderByDescending(value => value.NestedValue);
    

    Type parameters

    • SortT

    Parameters

    • selector: SelectorWithIndexFn<ValueT, SortT>

      User-defined selector function that selects the value to sort by.

    Returns IOrderedSeries<IndexT, ValueT, SortT>

    Returns a new series that has been ordered accorrding to the value chosen by the selector function.

parseDates

  • parseDates(formatString?: undefined | string): ISeries<IndexT, Date>
  • Parse a series with string values and convert it to a series with date values.

    example
    
    const parsed = series.parseDates();
    

    Parameters

    • Optional formatString: undefined | string

    Returns ISeries<IndexT, Date>

    Returns a new series with values parsed from strings to dates.

parseFloats

  • parseFloats(): ISeries<IndexT, number>
  • Parse a series with string values and convert it to a series with float values.

    example
    
    const parsed = series.parseFloats();
    

    Returns ISeries<IndexT, number>

    Returns a new series with values parsed from strings to floats.

parseInts

  • parseInts(): ISeries<IndexT, number>
  • Parse a series with string values and convert it to a series with int values.

    example
    
    const parsed = series.parseInts();
    

    Returns ISeries<IndexT, number>

    Returns a new series with values parsed from strings to ints.

percentChange

  • percentChange(period?: undefined | number): ISeries<IndexT, number>
  • Compute the percentage change between pairs or sets of values in the series. Percentages are expressed as 0-100 values.

    example
    
    const saleFigures = ... running series of daily sales figures ...
    const percentChanged = salesFigures.amountChanged(); // Percent that sales has changed, day to day.
    
    example
    
    const saleFigures = ... running series of daily sales figures ...
    const percentChanged = salesFigures.amountChanged(7); // Percent that sales has changed, week to week.
    

    Parameters

    • Optional period: undefined | number

    Returns ISeries<IndexT, number>

    Returns a new series where each value indicates the percent change from the previous number value in the original series.

proportionChange

  • proportionChange(period?: undefined | number): ISeries<IndexT, number>
  • Compute the proportion change between pairs or sets of values in the series. Proportions are expressed as 0-1 values.

    example
    
    const saleFigures = ... running series of daily sales figures ...
    const proportionChanged = salesFigures.amountChanged(); // Proportion that sales has changed, day to day.
    
    example
    
    const saleFigures = ... running series of daily sales figures ...
    const proportionChanged = salesFigures.amountChanged(7); // Proportion that sales has changed, week to week.
    

    Parameters

    • Optional period: undefined | number

    Returns ISeries<IndexT, number>

    Returns a new series where each value indicates the proportion change from the previous number value in the original series.

resetIndex

  • resetIndex(): ISeries<number, ValueT>
  • Resets the Index of the series back to the default zero-based sequential integer index.

    example
    
    const seriesWithResetIndex = series.resetIndex();
    

    Returns ISeries<number, ValueT>

    Returns a new series with the Index reset to the default zero-based index.

reverse

  • reverse(): ISeries<IndexT, ValueT>
  • Gets a new series in reverse order.

    example
    
    const reversed = series.reverse();
    

    Returns ISeries<IndexT, ValueT>

    Returns a new series that is the reverse of the original.

rollingWindow

  • rollingWindow(period: number): ISeries<number, ISeries<IndexT, ValueT>>
  • Partition a series into a new series of rolling data windows. Each value in the new series is a rolling chunk of data from the original series.

    example
    
    const salesData = ... // Daily sales data.
    const rollingWeeklySales = salesData.rollingWindow(7); // Get rolling window over weekly sales data.
    console.log(rollingWeeklySales.toString());
    

    Parameters

    • period: number

      The number of data values to include in each data window.

    Returns ISeries<number, ISeries<IndexT, ValueT>>

    Returns a new series, each value of which is a rolling chunk of the original series.

select

  • Generates a new series by repeatedly calling a user-defined selector function on each value in the original series.

    example
    
    function transformValue (inputValue) {
         const outputValue = {
             // ... construct output value derived from input value ...
         };
    
         return outputValue;
    }
    
    const transformedSeries = series.select(value => transformValue(value));
    

    Type parameters

    • ToT

    Parameters

    • selector: SelectorWithIndexFn<ValueT, ToT>

      A user-defined selector function that transforms each row to create the new dataframe.

    Returns ISeries<IndexT, ToT>

    Returns a new series with each value transformed by the selector function.

selectMany

  • Generates a new series by repeatedly calling a user-defined selector function on each row in the original series.

    Similar to the select function, but in this case the selector function produces a collection of output values that are flattened and merged to create the new series.

    example
    
    function produceOutputValues (inputValue) {
         const outputValues = [];
         while (someCondition) {
             // ... generate zero or more output values ...
             outputValues.push(... some generated value ...);
         }
         return outputValues;
    }
    
    const modifiedSeries = series.selectMany(value => produceOutputValues(value));
    

    Type parameters

    • ToT

    Parameters

    • selector: SelectorWithIndexFn<ValueT, Iterable<ToT>>

      A user-defined selector function that transforms each value into a collection of output values.

    Returns ISeries<IndexT, ToT>

    Returns a new series where each value has been transformed into 0 or more new values by the selector function.

sequentialDistinct

  • sequentialDistinct<ToT>(selector?: SelectorFn<ValueT, ToT>): ISeries<IndexT, ValueT>
  • Eliminates adjacent duplicate values.

    For each group of adjacent values that are equivalent only returns the last index/row for the group, thus ajacent equivalent values are collapsed down to the last value.

    example
    
    const seriesWithDuplicateRowsRemoved = series.sequentialDistinct(value => value);
    
    // Or
    const seriesWithDuplicateRowsRemoved = series.sequentialDistinct(value => value.someNestedField);
    

    Type parameters

    • ToT

    Parameters

    Returns ISeries<IndexT, ValueT>

    Returns a new series with groups of adjacent duplicate vlaues collapsed to a single value per group.

skip

  • skip(numValues: number): ISeries<IndexT, ValueT>
  • Skip a number of values in the series.

    example
    
    const seriesWithRowsSkipped = series.skip(10); // Skip 10 rows in the original series.
    

    Parameters

    • numValues: number

      Number of values to skip.

    Returns ISeries<IndexT, ValueT>

    Returns a new series with the specified number of values skipped.

skipUntil

  • Skips values in the series untils a condition evaluates to true or truthy.

    example
    
    const seriesWithRowsSkipped = series.skipUntil(salesFigure => salesFigure > 100); // Skip initial sales figures unitl we see one greater than 100.
    

    Parameters

    • predicate: PredicateFn<ValueT>

      Return true/truthy to stop skipping values in the original series.

    Returns ISeries<IndexT, ValueT>

    Returns a new series with all initial sequential values removed until the predicate returned true/truthy.

skipWhile

  • Skips values in the series while a condition evaluates to true or truthy.

    example
    
    const seriesWithRowsSkipped = series.skipWhile(salesFigure => salesFigure > 100); // Skip initial sales figure that are less than 100.
    

    Parameters

    • predicate: PredicateFn<ValueT>

      Returns true/truthy to continue to skip values in the original series.

    Returns ISeries<IndexT, ValueT>

    Returns a new series with all initial sequential values removed while the predicate returned true/truthy.

startAt

  • startAt(indexValue: IndexT): ISeries<IndexT, ValueT>
  • Gets a new series containing all values starting at or after the specified index value.

    example
    
    const series = new Series({
         index: [0, 1, 2, 3], // This is the default index.
         values: [10, 20, 30, 40],
    });
    
    const lastHalf = series.startAt(2);
    expect(lastHalf.toArray()).to.eql([30, 40]);
    
    example
    
    const timeSeries = ... a series indexed by date/time ...
    
    // Get all values starting at (or after) a particular date.
    const result = timeSeries.startAt(new Date(2016, 5, 4));
    

    Parameters

    • indexValue: IndexT

      The index value at which to start the new series.

    Returns ISeries<IndexT, ValueT>

    Returns a new series containing all values starting at or after the specified index value.

sum

  • sum(): number
  • Sum the values in a series and returns the result.

    example
    
    const totalSales = salesFigures.sum();
    

    Returns number

    Returns the sum of the number values in the series.

tail

  • tail(numValues: number): ISeries<IndexT, ValueT>
  • Get X values from the end of the series. Pass in a negative value to get all values at the tail except X values at the head.

    examples
    
    const sample = series.tail(12); // Take a sample of 12 values from the end of the series.
    

    Parameters

    • numValues: number

      Number of values to take.

    Returns ISeries<IndexT, ValueT>

    Returns a new series that has only the specified number of values taken from the end of the original series.

take

  • take(numRows: number): ISeries<IndexT, ValueT>
  • Take a number of values from the series.

    example
    
    const seriesWithRowsTaken = series.take(15); // Take only the first 15 values from the original series.
    

    Parameters

    • numRows: number

    Returns ISeries<IndexT, ValueT>

    Returns a new series with only the specified number of values taken from the original series.

takeUntil

  • Takes values from the series until a condition evaluates to true or truthy.

    example
    
    const seriesWithRowsTaken = series.takeUntil(salesFigure => salesFigure > 100); // Take all initial sales figures until we see one that is greater than 100.
    

    Parameters

    • predicate: PredicateFn<ValueT>

      Return true/truthy to stop taking values in the original series.

    Returns ISeries<IndexT, ValueT>

    Returns a new series with only the initial sequential values taken until the predicate returned true/truthy.

takeWhile

  • Takes values from the series while a condition evaluates to true or truthy.

    example
    
    const seriesWithRowsTaken = series.takeWhile(salesFigure => salesFigure > 100); // Take only initial sales figures that are greater than 100.
    

    Parameters

    • predicate: PredicateFn<ValueT>

      Returns true/truthy to continue to take values from the original series.

    Returns ISeries<IndexT, ValueT>

    Returns a new series with only the initial sequential values that were taken while the predicate returned true/truthy.

toArray

  • toArray(): any[]
  • Extract values from the series as an array. This forces lazy evaluation to complete.

    example
    const values = series.toArray();
    

    Returns any[]

    Returns an array of the values contained within the series.

toObject

  • toObject<KeyT, FieldT, OutT>(keySelector: function, valueSelector: function): OutT
  • Convert the series to a JavaScript object.

    example
    
    const someObject = series.toObject(
         value => value, // Specify the value to use for field names in the output object.
         value => value // Specify the value to use as the value for each field.
    );
    

    Type parameters

    • KeyT

    • FieldT

    • OutT

    Parameters

    • keySelector: function

      User-defined selector function that selects keys for the resulting object.

        • (value: ValueT): KeyT
        • Parameters

          • value: ValueT

          Returns KeyT

    • valueSelector: function

      User-defined selector function that selects values for the resulting object.

        • (value: ValueT): FieldT
        • Parameters

          • value: ValueT

          Returns FieldT

    Returns OutT

    Returns a JavaScript object generated from the series by applying the key and value selector functions.

toPairs

  • toPairs(): Object[]
  • Retreive the index, values pairs from the series as an array. Each pair is [index, value]. This forces lazy evaluation to complete.

    example
    const pairs = series.toPairs();
    

    Returns Object[]

    Returns an array of pairs that contains the series values. Each pair is a two element array that contains an index and a value.

toString

  • toString(): string
  • Format the series for display as a string. This forces lazy evaluation to complete.

    example
    
    console.log(series.toString());
    

    Returns string

    Generates and returns a string representation of the series.

toStrings

  • toStrings(formatString?: undefined | string): ISeries<IndexT, string>
  • Convert a series of values of different types to a series containing string values.

    example
    
    const result = series.toStrings("YYYY-MM-DD");
    
    example
    
    const result = series.toStrings("0.00");
    

    Parameters

    • Optional formatString: undefined | string

    Returns ISeries<IndexT, string>

    Returns a new series values converted from values to strings.

truncateStrings

  • truncateStrings(maxLength: number): ISeries<IndexT, ValueT>
  • Produces a new series with all string values truncated to the requested maximum length.

    example
    
    const truncated = series.truncateStrings(10); // Truncate all string values to max length of 10 characters.
    

    Parameters

    • maxLength: number

      The maximum length of the string values after truncation.

    Returns ISeries<IndexT, ValueT>

    Returns a new series with strings that are truncated to the specified maximum length.

union

  • Creates a new series by merging two input dataframes. The resulting series contains the union of value from the two input series. These are the unique combination of values in both series. This is basically a concatenation and then elimination of duplicates.

    example
    
    const seriesA = ...
    const seriesB = ...
    const merged = seriesA.union(seriesB);
    
    example
    
    // Merge two sets of customer records that may contain the same
    // customer record in each set. This is basically a concatenation
    // of the series and then an elimination of any duplicate records
    // that result.
    const customerRecordsA = ...
    const customerRecordsB = ...
    const mergedCustomerRecords = customerRecordsA.union(
         customerRecordsB,
         customerRecord => customerRecord.CustomerId
    );
    
    example
    
    // Note that you can achieve the exact same result as the previous
    // example by doing a {@link Series.concat) and {@link Series.distinct}
    // of the input series and then an elimination of any duplicate records
    // that result.
    const customerRecordsA = ...
    const customerRecordsB = ...
    const mergedCustomerRecords = customerRecordsA
         .concat(customerRecordsB)
         .distinct(customerRecord => customerRecord.CustomerId);
    

    Type parameters

    • KeyT

    Parameters

    • other: ISeries<IndexT, ValueT>

      The other series to merge.

    • Optional selector: SelectorFn<ValueT, KeyT>

    Returns ISeries<IndexT, ValueT>

    Returns the union of the two series.

variableWindow

  • Partition a series into a new series of variable-length data windows where the divisions between the data chunks are defined by a user-provided comparer function.

    example
    
    

    function rowComparer (valueA, valueB) { if (... valueA should be in the same data window as valueB ...) { return true; } else { return false; } };

    const variableWindows = series.variableWindow(rowComparer);

    Parameters

    • comparer: ComparerFn<ValueT, ValueT>

      Function that compares two adjacent data values and returns true if they should be in the same window.

    Returns ISeries<number, ISeries<IndexT, ValueT>>

    Returns a new series, each value of which is a chunk of data from the original series.

where

  • Filter the series using user-defined predicate function.

    example
    
    const filtered = series.where(salesFigure => salesFigure > 100); // Filter so we only have sales figures greater than 100.
    

    Parameters

    • predicate: PredicateFn<ValueT>

      Predicte function to filter values from the series. Returns true/truthy to keep values, or false/falsy to omit values.

    Returns ISeries<IndexT, ValueT>

    Returns a new series containing only the values from the original series that matched the predicate.

window

  • Partition a series into a Series of data windows. Each value in the new series is a chunk of data from the original series.

    example
    
    const windows = series.window(2); // Get values in pairs.
    const pctIncrease = windows.select(pair => (pair.last() - pair.first()) / pair.first());
    console.log(pctIncrease.toString());
    
    example
    
    const salesDf = ... // Daily sales data.
    const weeklySales = salesDf.window(7); // Partition up into weekly data sets.
    console.log(weeklySales.toString());
    

    Parameters

    • period: number

      The number of values to include in each data window.

    Returns ISeries<number, ISeries<IndexT, ValueT>>

    Returns a new series, each value of which is a chunk (data window) of the original series.

withIndex

  • withIndex<NewIndexT>(newIndex: Iterable<NewIndexT> | SelectorFn<ValueT, NewIndexT>): ISeries<NewIndexT, ValueT>
  • Apply a new Index to the series.

    example
    
    const indexedSeries = series.withIndex([10, 20, 30]);
    
    example
    
    const indexedSeries = series.withIndex(someOtherSeries);
    
    example
    
    const indexedSeries = series.withIndex(value => computeIndexFromValue(value));
    
    example
    
    const indexedSeries = series.withIndex(value => value + 20);
    

    Type parameters

    • NewIndexT

    Parameters

    • newIndex: Iterable<NewIndexT> | SelectorFn<ValueT, NewIndexT>

      The new array or iterable to be the new Index of the series. Can also be a selector to choose the Index for each value in the series.

    Returns ISeries<NewIndexT, ValueT>

    Returns a new series with the specified Index attached.

zip

  • zip<Index2T, Value2T, ResultT>(s2: ISeries<Index2T, Value2T>, zipper: Zip2Fn<ValueT, Value2T, ResultT>): ISeries<IndexT, ResultT>
  • zip<Index2T, Value2T, Index3T, Value3T, ResultT>(s2: ISeries<Index2T, Value2T>, s3: ISeries<Index3T, Value3T>, zipper: Zip3Fn<ValueT, Value2T, Value3T, ResultT>): ISeries<IndexT, ResultT>
  • zip<Index2T, Value2T, Index3T, Value3T, Index4T, Value4T, ResultT>(s2: ISeries<Index2T, Value2T>, s3: ISeries<Index3T, Value3T>, s4: ISeries<Index4T, Value4T>, zipper: Zip3Fn<ValueT, Value2T, Value3T, ResultT>): ISeries<IndexT, ResultT>
  • Merge together multiple series to create a new series. Preserves the index of the first series.

    example
    
    const a = new Series([1, 2, 3]);
    const b = new Series([10, 20, 30]);
    const zipped = a.zip(b (valueA, valueB) => valueA + valueB);
    

    Type parameters

    • Index2T

    • Value2T

    • ResultT

    Parameters

    • s2: ISeries<Index2T, Value2T>
    • zipper: Zip2Fn<ValueT, Value2T, ResultT>

      User-defined zipper function that merges rows. It produces values for the new series based-on values from the input series.

    Returns ISeries<IndexT, ResultT>

    Returns a single series merged from multiple input series.

  • Type parameters

    • Index2T

    • Value2T

    • Index3T

    • Value3T

    • ResultT

    Parameters

    • s2: ISeries<Index2T, Value2T>
    • s3: ISeries<Index3T, Value3T>
    • zipper: Zip3Fn<ValueT, Value2T, Value3T, ResultT>

    Returns ISeries<IndexT, ResultT>

  • Type parameters

    • Index2T

    • Value2T

    • Index3T

    • Value3T

    • Index4T

    • Value4T

    • ResultT

    Parameters

    • s2: ISeries<Index2T, Value2T>
    • s3: ISeries<Index3T, Value3T>
    • s4: ISeries<Index4T, Value4T>
    • zipper: Zip3Fn<ValueT, Value2T, Value3T, ResultT>

    Returns ISeries<IndexT, ResultT>

Static concat

  • concat<IndexT, ValueT>(series: ISeries<IndexT, ValueT>[]): ISeries<IndexT, ValueT>
  • Concatenate multiple series into a single series.

    Type parameters

    • IndexT

    • ValueT

    Parameters

    • series: ISeries<IndexT, ValueT>[]

      Array of series to concatenate.

    Returns ISeries<IndexT, ValueT>

    Returns a single series concatenated from multiple input series.

Static parseDate

  • parseDate(value: any | undefined, valueIndex: number, formatString?: undefined | string): Date | undefined
  • Parameters

    • value: any | undefined
    • valueIndex: number
    • Optional formatString: undefined | string

    Returns Date | undefined

Static parseFloat

  • parseFloat(value: any | undefined, valueIndex: number): number | undefined
  • Parameters

    • value: any | undefined
    • valueIndex: number

    Returns number | undefined

Static parseInt

  • parseInt(value: any | undefined, valueIndex: number): number | undefined
  • Parameters

    • value: any | undefined
    • valueIndex: number

    Returns number | undefined

Static toString

  • toString(value: any | undefined, formatString?: undefined | string): string | undefined | null
  • Parameters

    • value: any | undefined
    • Optional formatString: undefined | string

    Returns string | undefined | null

Static zip

  • zip<IndexT, ValueT, ResultT>(series: ISeries<IndexT, ValueT>[], zipper: ZipNFn<ValueT, ResultT>): ISeries<IndexT, ResultT>
  • Zip together multiple series to create a new series. Preserves the index of the first series.

    Type parameters

    • IndexT

    • ValueT

    • ResultT

    Parameters

    • series: ISeries<IndexT, ValueT>[]

      Multiple arguments. Each can be either a series or an array of series.

    • zipper: ZipNFn<ValueT, ResultT>

      Selector function that produces a new series based on the input series.

    Returns ISeries<IndexT, ResultT>

    Returns a single series zipped from multiple input series.

Generated using TypeDoc