ml-array-rescale
TypeScript icon, indicating that this package has built-in type declarations

1.3.7 • Public • Published

array-rescale

NPM version npm download

Rescale an array into a range.

Installation

$ npm install --save ml-array-rescale

Usage

rescale(input[, options])

Rescales the values in the input so they fit between two new values.

Options:

  • min: the new minimum value (default: 0)
  • max: the new maximum value (default: 1)
  • output: an array to use for output. You can pass input here to get an in-place modification.
import rescale from 'ml-array-rescale';

const result = rescale([0, 1, 2, 3, 4]);
// [0, 0.25, 0.5, 0.75, 1]

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.3.7376,095latest

Version History

VersionDownloads (Last 7 Days)Published
1.3.7376,095
1.3.62,133
1.3.52,610
1.3.451
1.3.31
1.3.23,872
1.3.1461
1.3.03
1.2.265
1.2.11,393
1.2.01
1.1.10
1.1.03
1.0.21
1.0.10
1.0.00

Package Sidebar

Install

npm i ml-array-rescale

Weekly Downloads

386,689

Version

1.3.7

License

MIT

Unpacked Size

10.5 kB

Total Files

8

Last publish

Collaborators

  • lpatiny
  • mljs-bot
  • stropitek
  • targos