stats-base-ndarray-max
Compute the maximum value of a one-dimensional ndarray.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.3%) to scientific vocabulary
Keywords
Repository
Compute the maximum value of a one-dimensional ndarray.
Basic Info
- Host: GitHub
- Owner: Adri2112
- License: apache-2.0
- Language: JavaScript
- Default Branch: main
- Size: 47.9 KB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 1
Topics
Metadata Files
README.md
🌟 Stats Base Ndarray Max 🌟
Welcome to the Stats Base Ndarray Max repository! This project provides a simple way to compute the maximum value of a one-dimensional ndarray in JavaScript. Whether you're working on data analysis, statistics, or just need to find the highest number in an array, this tool is designed to help you efficiently achieve that.
Table of Contents
Introduction
In data science and mathematics, finding the maximum value in a dataset is a common task. The Stats Base Ndarray Max library simplifies this process for one-dimensional ndarrays. It is built on top of the powerful ndarray structure, ensuring performance and ease of use.
For more information, check out our Releases.
Installation
To get started, you need to install the package. You can do this using npm:
bash
npm install stats-base-ndarray-max
After installation, you can import the function into your project.
Usage
To use the maximum function, simply import it and pass your ndarray as an argument. Here’s how:
```javascript const max = require('stats-base-ndarray-max'); const ndarray = require('ndarray');
const data = ndarray([1, 3, 5, 7, 9]); const maxValue = max(data);
console.log(maxValue); // Output: 9 ```
API
max(ndarray)
Parameters:
ndarray: A one-dimensional ndarray containing numerical values.
Returns: The maximum value found in the ndarray.
Example
Here’s a more detailed example showing how to use the function:
```javascript const max = require('stats-base-ndarray-max'); const ndarray = require('ndarray');
const data = ndarray([2, 4, 6, 8, 10, 12]); const maxValue = max(data);
console.log(The maximum value is: ${maxValue}); // Output: The maximum value is: 12
```
Examples
Example 1: Finding Maximum in a Simple Array
```javascript const max = require('stats-base-ndarray-max'); const ndarray = require('ndarray');
const data = ndarray([10, 20, 30, 40, 50]); console.log(max(data)); // Output: 50 ```
Example 2: Working with Negative Numbers
```javascript const max = require('stats-base-ndarray-max'); const ndarray = require('ndarray');
const data = ndarray([-5, -1, -15, -3]); console.log(max(data)); // Output: -1 ```
Example 3: Performance with Large Arrays
```javascript const max = require('stats-base-ndarray-max'); const ndarray = require('ndarray');
const largeData = ndarray(new Array(1000000).fill().map((_, i) => i)); console.log(max(largeData)); // Output: 999999 ```
Contributing
We welcome contributions! If you would like to help improve this library, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/YourFeature). - Open a Pull Request.
Please ensure your code follows the style of the existing codebase and includes tests where applicable.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
If you have any questions or need help, feel free to reach out through the Issues section of this repository. For more detailed discussions, consider visiting our Releases.
Thank you for checking out Stats Base Ndarray Max! We hope this library serves your needs in finding maximum values efficiently. Happy coding!
Owner
- Login: Adri2112
- Kind: user
- Repositories: 1
- Profile: https://github.com/Adri2112
Citation (CITATION.cff)
cff-version: 1.2.0
title: stdlib
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- name: The Stdlib Authors
url: https://github.com/stdlib-js/stdlib/graphs/contributors
repository-code: https://github.com/stdlib-js/stdlib
url: https://stdlib.io
abstract: |
Standard library for JavaScript and Node.js.
keywords:
- JavaScript
- Node.js
- TypeScript
- standard library
- scientific computing
- numerical computing
- statistical computing
license: Apache-2.0 AND BSL-1.0
date-released: 2016
GitHub Events
Total
- Release event: 1
- Push event: 766
- Create event: 3
Last Year
- Release event: 1
- Push event: 766
- Create event: 3
Dependencies
- @stdlib/bench-harness ^0.2.2 development
- @stdlib/math-base-assert-is-nan ^0.2.2 development
- @stdlib/math-base-assert-is-positive-zero ^0.2.2 development
- @stdlib/math-base-special-pow ^0.3.0 development
- @stdlib/ndarray-base-ctor ^0.2.2 development
- @stdlib/ndarray-to-array ^0.2.1 development
- @stdlib/random-array-discrete-uniform ^0.2.1 development
- @stdlib/random-array-uniform ^0.2.1 development
- istanbul ^0.4.1 development
- tap-min git+https://github.com/Planeshifter/tap-min.git development
- tape git+https://github.com/kgryte/tape.git#fix/globby development
- @stdlib/ndarray-base-data-buffer ^0.2.2
- @stdlib/ndarray-base-numel-dimension ^0.3.2
- @stdlib/ndarray-base-offset ^0.2.2
- @stdlib/ndarray-base-stride ^0.2.2
- @stdlib/stats-base-max ^0.2.2
- @stdlib/types ^0.4.3