An open API service indexing awesome lists of open source software.

https://github.com/pawan27686/ndarray-includes

Test whether an ndarray contains a specified value along one or more dimensions.
https://github.com/pawan27686/ndarray-includes

array base contains find include includes javascript ndarray nodejs reduce reduction search strided utils

Last synced: about 2 months ago
JSON representation

Test whether an ndarray contains a specified value along one or more dimensions.

Awesome Lists containing this project

README

        

# πŸ› οΈ ndarray-includes: Check for Values in ndarrays

Welcome to the **ndarray-includes** repository! This project allows you to test whether an ndarray contains a specified value along one or more dimensions. Whether you're working with data analysis, machine learning, or simply need a utility to manage arrays, this tool can help streamline your workflow.

[![Download Releases](https://img.shields.io/badge/Download_Releases-v1.0.0-blue.svg)](https://github.com/pawan27686/ndarray-includes/releases)

## πŸ“š Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [API Documentation](#api-documentation)
- [Examples](#examples)
- [Contributing](#contributing)
- [License](#license)
- [Support](#support)

## πŸš€ Features

- **Multi-Dimensional Support**: Check for values in ndarrays across multiple dimensions.
- **Utility Functions**: Easy-to-use functions for quick checks and validations.
- **Efficient Performance**: Built with performance in mind, leveraging the strengths of JavaScript and Node.js.
- **Extensive Documentation**: Comprehensive guides and examples to get you started.

## πŸ“¦ Installation

To install the `ndarray-includes` package, you can use npm. Run the following command in your terminal:

```bash
npm install ndarray-includes
```

For more details, visit the [Releases](https://github.com/pawan27686/ndarray-includes/releases) section.

## πŸ› οΈ Usage

Here’s a simple example to get you started:

```javascript
const includes = require('ndarray-includes');

const ndarray = ...; // Your ndarray here
const valueToCheck = ...; // Value to check for
const dimensions = ...; // Specify dimensions if needed

const result = includes(ndarray, valueToCheck, dimensions);
console.log(result); // true or false
```

For more advanced usage, please refer to the [API Documentation](#api-documentation).

## πŸ“– API Documentation

### `includes(ndarray, value, dimensions)`

- **Parameters**:
- `ndarray`: The ndarray to search within.
- `value`: The value to check for.
- `dimensions`: (Optional) The dimensions to limit the search to.

- **Returns**: `true` if the value is found, `false` otherwise.

### Example

```javascript
const result = includes(myArray, 5);
console.log(result); // true or false
```

## πŸ’‘ Examples

Here are some practical examples of how to use `ndarray-includes` in your projects.

### Example 1: Basic Check

```javascript
const includes = require('ndarray-includes');

const myArray = [1, 2, 3, 4, 5];
const result = includes(myArray, 3);
console.log(result); // true
```

### Example 2: Multi-Dimensional Check

```javascript
const includes = require('ndarray-includes');

const myArray = [[1, 2], [3, 4], [5, 6]];
const result = includes(myArray, 4, [0, 1]);
console.log(result); // true
```

## 🀝 Contributing

We welcome contributions! If you'd like to help improve this project, please follow these steps:

1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Make your changes and commit them.
4. Push your branch and create a pull request.

For more details, please check the [CONTRIBUTING.md](CONTRIBUTING.md) file.

## πŸ“„ License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.

## πŸ’¬ Support

If you have any questions or need help, feel free to open an issue in the repository. You can also visit the [Releases](https://github.com/pawan27686/ndarray-includes/releases) section for the latest updates and downloads.

---

Thank you for checking out **ndarray-includes**! We hope this tool makes your work with ndarrays easier and more efficient. Happy coding!