ml-array-xy-centroids-merge

1.0.2 • Public • Published

array-xy-centroids-merge

NPM version npm download

Merge abscissa values if the ordinate value is in a list of centroids.

Installation

$ npm install --save ml-array-xy-ranges-merge

Usage

import mergeByCentroids from 'ml-array-xy-centroids-merge';

const originalPoints = {
  x: [0.01, 1.008, 1.01, 1.012, 1.02, 1.04],
  y: [1, 1, 1, 1, 1, 1]
};

mergeByCentroids(originalPoints, [1.01, 1.04]);

/* result -> {
    x: [1.01, 1.04],
    y: [3, 1]
} */

License

MIT

/ml-array-xy-centroids-merge/

    Package Sidebar

    Install

    npm i ml-array-xy-centroids-merge

    Weekly Downloads

    206

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    7.65 kB

    Total Files

    7

    Last publish

    Collaborators

    • stropitek
    • targos
    • lpatiny
    • mljs-bot