It will do array manipulations functions like Searching, Sorting, Sorting, Min/Max value.
Project description
mds_array_manipulation
Summary
Project Summary
The package is intended to do array manipulations functions like Searching, Sorting, Counting non-zero elements, Finding indices of max value. This is a package developed for the group-17 project for the UBC MDS DSCI 524 (Collaborative Software Development) course.
Functions Included in the Package
-
sort_array
: Takes a numpy array of integers or strings and returns the array in sorted order -
search_array
: Searches for and returns the index of a specified element in a numpy array, if it exists -
count_nonzero_elements
: Count the number of non zero elements in an array -
argmax
: Returns the index of the max element in the array
Fit into the Python Ecosystem
There are several Python packages focused on array manipulation, such as numpy, which are used for a wide range of array manipulation. However, the package aims to recreate some of the basic array operations available in the numpy package.
Installation
Note: This package is currently under development and not yet available on PyPI. To install, please clone the repository and install the package locally. Follow the below instructions to install the package.
- Clone the github repository using:
https://github.com/UBC-MDS/mds_array_manipulation.git
- Run the below commands to create the virual environment:
$ conda create --name mds_array_manipulation python=3.9 -y
$ conda activate mds_array_manipulation
- You can install
mds_array_manipulation
package usingpoetry
$ poetry install
If you dont have poetry installed in your base environment, you can follow the installation guide for poetry.
- To get the coverage report, run the following code:
poetry run pytest tests/ --cov=src/mds_array_manipulation/
Future Update
Once the package is full developed and published to PyPI, you can use it using below command:
$ pip install mds_array_manipulation
Features
Contains functions: Searching, Sorting, Counting non-zero elements, Finding indices of max value. This package is a group-17 project for the UBC MDS DSCI 524 (Collaborative Software Development) course.
Dependencies
- Python 3 or greater
Usage
Example usage:
>>> import numpy as np
>>> from mds_array_manipulation.search_array import search_array
>>> from mds_array_manipulation.argmax import argmax
>>> from mds_array_manipulation.sort_array import sort_array
>>> from mds_array_manipulation.count_nonzero_elements import count_nonzero_elements
>>> arr = np.array([20, 10, 40, 30, 50, 90, 60])
>>> search_array(arr, 50)
4
>>> argmax(arr)
5
>>> sort_array(arr)
array([10, 20, 30, 40, 50, 60, 90])
>>> count_nonzero_elements(arr)
{'Total Non-Zero Elements in Array': 7}
Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
Contributors
- Sean McKay - @sean-m-mckay
- Kittipong Wongwipasamitkun (Jo) - @jokittipong
- Yan Zeng - @Owl64901
- Aishwarya Nadimpally - @Aishwarya120111
License
mds_array_manipulation
was created by Kittipong Wongwipasamitkun, Sean Mckay, Yan Zeng, Aishwarya Nadimpally. It is licensed under the terms of the MIT license.
Credits
mds_array_manipulation
was created with cookiecutter
and the py-pkgs-cookiecutter
template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mds_array_manipulation-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9d519a446378aac60b7593a6f0ff91c5317ff6a2fa9f6a4466833550795e809 |
|
MD5 | 403719d2f28ac481810d2599d6045461 |
|
BLAKE2b-256 | b0e38f6281ef64d3278c68f19efc9390cea434d3a9c41fe7568257682f9bbbc8 |
Hashes for mds_array_manipulation-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef67a97065a5ead3e3faf19e4672b010032660c48bda58329433480e0a20b3ac |
|
MD5 | 20640c776444e273d9dc6e7bff963179 |
|
BLAKE2b-256 | de29280609fce91fb3eb1b08ce16fa2c8ccbfb3ecf3d8a2362309e8f2632e36b |