Skip to content

docs: improve README examples of stats/iter namespace . #1738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lib/node_modules/@stdlib/stats/iter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,23 @@ var getKeys = require( '@stdlib/utils/keys' );
var ns = require( '@stdlib/stats/iter' );

console.log( getKeys( ns ) );

var array2iterator = require( '@stdlib/array/to-iterator' );

// Example data: An iterator of temperature values
var temperatures = array2iterator([20, 22, 25, 18, 23, 21, 19, 20, 24, 26]);

// Compute the minimum temperature
var minTemperature = ns.itermin( temperatures );
// returns 18.0

// Compute the maximum temperature
var maxTemperature = ns.itermax( temperatures );
// returns 26.0

// Compute the arithmetic mean temperature
var meanTemperature = ns.itermean( temperatures );
// returns 21.8
```

</section>
Expand Down