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.
- Host: GitHub
- URL: https://github.com/pawan27686/ndarray-includes
- Owner: pawan27686
- License: apache-2.0
- Created: 2025-04-08T17:06:32.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-04-08T18:30:49.000Z (about 2 months ago)
- Last Synced: 2025-04-08T18:36:51.677Z (about 2 months ago)
- Topics: array, base, contains, find, include, includes, javascript, ndarray, nodejs, reduce, reduction, search, strided, utils
- Language: JavaScript
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Security: SECURITY.md
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.
[](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 neededconst 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!