Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

ml-arrayxy-uniquex

1.0.1 • Public • Published

arrayxy-uniquex

NPM version build status David deps npm download

Function to sum the y values if the x values are equals. The x array has to be ordered. It is an in place modification

Installation

npm i ml-arrayxy-uniquex

const uniqueX=require('ml-arrayxy-uniquex');

  var x = [0, 0, 1, 2, 3, 3];
  var y = [1, 2, 3, 4, 5, 6];
  uniqueX({ x, y });

  // x = [0, 1, 2, 3]
  // y = [3, 3, 4, 11]

API Documentation

License

MIT

Install

npm i ml-arrayxy-uniquex

DownloadsWeekly Downloads

135

Version

1.0.1

License

MIT

Unpacked Size

7.31 kB

Total Files

7

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar