weighted-mean

1.0.2 • Public • Published

weighted-mean

NPM version Downloads Build Status Coverage Status Dependency status Dev Dependency status

Calculates the weighted mean of an array of numbers.

Installation

$ npm install weighted-mean - NPM
$ bower install weighted-mean - bower

The browser file is named index.umd.js which supports CommonJS, AMD and globals (weightedMean). If you want to run this module on old browsers, you must include es5-shim.

Usage

The example bellow is based on nodejs.

const weightedMean = require('weighted-mean');
 
const mean = weightedMean([
    [100, 2],   // 100 is the value, 2 is the weight
    [50, 4],
    [25, 1],
]);

Tests

$ npm test

License

Released under the MIT License.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    4,691
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    4,691
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i weighted-mean

Weekly Downloads

4,691

Version

1.0.2

License

MIT

Last publish

Collaborators

  • satazor