stats-array-mskmax

Calculate the maximum value of an array according to a mask.

https://github.com/santhoshkumar2801/stats-array-mskmax

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 (15.2%) to scientific vocabulary

Keywords

array domain extent extremes javascript mask masked masked-array mathematics maximum nodejs statistics stats stdlib
Last synced: 6 months ago · JSON representation ·

Repository

Calculate the maximum value of an array according to a mask.

Basic Info
  • Host: GitHub
  • Owner: Santhoshkumar2801
  • License: apache-2.0
  • Language: JavaScript
  • Default Branch: main
  • Size: 48.8 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Topics
array domain extent extremes javascript mask masked masked-array mathematics maximum nodejs statistics stats stdlib
Created 10 months ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Security

README.md

🌟 Stats Array MskMax: Maximize Your Array with a Mask! 🌟

Welcome to the Stats Array MskMax repository! This project allows you to calculate the maximum value of an array while applying a mask. It is a simple yet powerful tool for anyone working with statistical data in JavaScript.

Download Release

📚 Table of Contents

  1. Introduction
  2. Features
  3. Installation
  4. Usage
  5. API Reference
  6. Examples
  7. Contributing
  8. License
  9. Contact

Introduction

In many data analysis scenarios, you may need to find the maximum value of an array but only for certain elements. The Stats Array MskMax library provides a straightforward way to apply a mask to your data. This enables you to filter out unwanted values and focus on the relevant data points.

Features

  • Masking: Apply a mask to filter elements.
  • Maximum Calculation: Efficiently find the maximum value from the masked array.
  • Easy Integration: Works seamlessly with Node.js and JavaScript environments.
  • Lightweight: Minimal dependencies for faster performance.
  • Robust Documentation: Comprehensive guides and examples.

Installation

To install the Stats Array MskMax library, you can use npm. Open your terminal and run the following command:

bash npm install stats-array-mskmax

You can also download the latest release directly from the Releases section.

Usage

Using the Stats Array MskMax library is simple. First, require the library in your JavaScript file:

javascript const mskMax = require('stats-array-mskmax');

Then, you can use the mskMax function to calculate the maximum value of your array with a mask.

Basic Syntax

javascript const max = mskMax(array, mask);

  • array: The input array from which to find the maximum value.
  • mask: A boolean array that indicates which elements to include in the calculation.

Example

Here’s a quick example to illustrate how it works:

```javascript const array = [1, 2, 3, 4, 5]; const mask = [false, true, true, false, true];

const maxValue = mskMax(array, mask); console.log(maxValue); // Output: 5 ```

API Reference

mskMax(array, mask)

  • Parameters:
    • array (Array): The array of numbers.
    • mask (Array): A boolean array where true indicates the elements to consider.
  • Returns: Number - The maximum value from the masked array.

Error Handling

If the array and mask do not match in length, the function will throw an error. Make sure both arrays are of the same size.

Examples

Example 1: Basic Masking

```javascript const data = [10, 20, 30, 40, 50]; const mask = [true, false, true, false, true];

const result = mskMax(data, mask); console.log(result); // Output: 50 ```

Example 2: All Elements Masked

```javascript const data = [5, 15, 25, 35, 45]; const mask = [true, true, true, true, true];

const result = mskMax(data, mask); console.log(result); // Output: 45 ```

Example 3: No Elements Masked

```javascript const data = [1, 2, 3, 4, 5]; const mask = [false, false, false, false, false];

const result = mskMax(data, mask); console.log(result); // Output: -Infinity ```

Contributing

We welcome contributions to improve the Stats Array MskMax library. If you want to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes.
  4. Commit your changes with a clear message.
  5. Push your branch to your fork.
  6. Create a pull request.

Your contributions help us enhance the library and make it more useful for everyone.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or feedback, feel free to reach out:

Explore more about this project and download the latest release from the Releases section. Thank you for using Stats Array MskMax!


Feel free to modify or expand upon this README as needed. Your contributions and feedback are always welcome!

Owner

  • Login: Santhoshkumar2801
  • Kind: user

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
  • Watch event: 1
  • Push event: 987
  • Create event: 2
Last Year
  • Release event: 1
  • Watch event: 1
  • Push event: 987
  • Create event: 2

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

package.json npm
  • @stdlib/array-base-to-accessor-array ^0.2.2 development
  • @stdlib/array-bool ^0.1.0 development
  • @stdlib/array-complex128 ^0.3.0 development
  • @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/random-array-bernoulli ^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/array-base-assert-contains ^0.2.2
  • @stdlib/array-base-join ^0.1.1
  • @stdlib/array-dtype ^0.3.0
  • @stdlib/array-dtypes ^0.3.0
  • @stdlib/assert-is-collection ^0.2.2
  • @stdlib/error-tools-fmtprodmsg ^0.2.2
  • @stdlib/stats-base-mskmax ^0.2.2
  • @stdlib/string-format ^0.2.2
  • @stdlib/types ^0.4.3