Name | datatransformationslibrary JSON |
Version |
0.1.2
JSON |
| download |
home_page | |
Summary | |
upload_time | 2023-08-17 13:26:12 |
maintainer | |
docs_url | None |
author | Your Name |
requires_python | >=3.9,<4.0 |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Data Transformations Library
This library provides essential functions for manipulating and transforming data structures commonly used in data science and machine learning.
## Table of Contents
- [Installation](#installation)
- [Functions](#functions)
- [transpose2d](#transpose2d)
- [window1d](#window1d)
- [convolution2d](#convolution2d)
- [Running Tests](#running-tests)
- [Contribution](#contribution)
- [License](#license)
## Installation
# Clone the repository
```bash
git clone git@github.com:TuringCollegeSubmissions/smizak-DE2.1.git
```
# Navigate to the directory
``` bash
cd smizak-DE2.1
```
# Install necessary packages
``` bash
pip install -r requirements.txt
```
# Install from pypi
Alternatively one can install the package from version published on pypi.
package can be found on https://pypi.org/project/datatransformationslibrary/
``` bash
pip install datatransformationslibrary
```
## Functions
### transpose2d
Transposes a 2D matrix.
**Usage:**
```python
from src.DataTransformationsLibrary import transpose2d
result = transpose2d(input_matrix)
```
**Arguments:**
- `input_matrix (list[list[float]])`: A 2D matrix to transpose.
**Returns:**
- A list representing the transposed matrix.
**Raises:**
- `ValueError`: If the input matrix is empty.
- `ValueError`: If all rows of the matrix do not have the same length.
### window1d
Generates windows of the specified size, shift, and stride from the input array.
**Usage:**
```python
from src.DataTransformationsLibrary import window1d
result = window1d(input_array, size, shift=1, stride=1)
```
**Arguments:**
- `input_array (Union[list, np.ndarray])`: 1D list or numpy array to generate windows from.
- `size (int)`: The size of each window.
- `shift (int, optional)`: Number of positions to move the window each iteration. Defaults to 1.
- `stride (int, optional)`: The step between consecutive elements within each window. Defaults to 1.
**Returns:**
- A list of windows.
**Raises:**
- `ValueError`: If input_array is not a list or 1D numpy array.
- `ValueError`: If input_array is not 1D.
### convolution2d
Performs a 2D convolution operation on the input matrix with a specified kernel.
**Usage:**
```python
from src.DataTransformationsLibrary import convolution2d
result = convolution2d(input_matrix, kernel, stride=1)
```
**Arguments:**
- `input_matrix (np.ndarray)`: A 2D input matrix for convolution.
- `kernel (np.ndarray)`: A 2D kernel for convolution.
- `stride (int, optional)`: The step size to use when applying the kernel. Defaults to 1.
**Returns:**
- A matrix resulting from the convolution operation.
**Raises:**
- `ValueError`: If stride is less than or equal to 0.
## Running Tests
To ensure the integrity of this library, a comprehensive set of tests are provided. To run the tests:
# Ensure pytest is installed
```bash
pip install pytest
```
# Navigate to the tests directory
``` bash
# Navigate to tests directory
cd test
# Run the tests
pytest
```
Raw data
{
"_id": null,
"home_page": "",
"name": "datatransformationslibrary",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/68/f8/47043a70c7cc8e91cd6a19daf3b898932a3d20b02f7800b4ab60b98828f1/datatransformationslibrary-0.1.2.tar.gz",
"platform": null,
"description": "# Data Transformations Library\n\nThis library provides essential functions for manipulating and transforming data structures commonly used in data science and machine learning.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Functions](#functions)\n - [transpose2d](#transpose2d)\n - [window1d](#window1d)\n - [convolution2d](#convolution2d)\n- [Running Tests](#running-tests)\n- [Contribution](#contribution)\n- [License](#license)\n\n## Installation\n\n\n# Clone the repository\n```bash\ngit clone git@github.com:TuringCollegeSubmissions/smizak-DE2.1.git\n```\n\n# Navigate to the directory\n``` bash\ncd smizak-DE2.1\n```\n\n# Install necessary packages\n``` bash\npip install -r requirements.txt\n```\n\n# Install from pypi\nAlternatively one can install the package from version published on pypi.\npackage can be found on https://pypi.org/project/datatransformationslibrary/\n``` bash\npip install datatransformationslibrary\n```\n\n## Functions\n\n### transpose2d\n\nTransposes a 2D matrix.\n\n**Usage:**\n\n```python\nfrom src.DataTransformationsLibrary import transpose2d\nresult = transpose2d(input_matrix)\n```\n\n**Arguments:**\n\n- `input_matrix (list[list[float]])`: A 2D matrix to transpose.\n\n**Returns:**\n\n- A list representing the transposed matrix.\n\n**Raises:**\n\n- `ValueError`: If the input matrix is empty.\n- `ValueError`: If all rows of the matrix do not have the same length.\n\n### window1d\n\nGenerates windows of the specified size, shift, and stride from the input array.\n\n**Usage:**\n\n```python\nfrom src.DataTransformationsLibrary import window1d\nresult = window1d(input_array, size, shift=1, stride=1)\n```\n\n**Arguments:**\n\n- `input_array (Union[list, np.ndarray])`: 1D list or numpy array to generate windows from.\n- `size (int)`: The size of each window.\n- `shift (int, optional)`: Number of positions to move the window each iteration. Defaults to 1.\n- `stride (int, optional)`: The step between consecutive elements within each window. Defaults to 1.\n\n**Returns:**\n\n- A list of windows.\n\n**Raises:**\n\n- `ValueError`: If input_array is not a list or 1D numpy array.\n- `ValueError`: If input_array is not 1D.\n\n### convolution2d\n\nPerforms a 2D convolution operation on the input matrix with a specified kernel.\n\n**Usage:**\n\n```python\nfrom src.DataTransformationsLibrary import convolution2d\nresult = convolution2d(input_matrix, kernel, stride=1)\n```\n\n**Arguments:**\n\n- `input_matrix (np.ndarray)`: A 2D input matrix for convolution.\n- `kernel (np.ndarray)`: A 2D kernel for convolution.\n- `stride (int, optional)`: The step size to use when applying the kernel. Defaults to 1.\n\n**Returns:**\n\n- A matrix resulting from the convolution operation.\n\n**Raises:**\n\n- `ValueError`: If stride is less than or equal to 0.\n\n## Running Tests\n\nTo ensure the integrity of this library, a comprehensive set of tests are provided. To run the tests:\n\n# Ensure pytest is installed\n```bash\npip install pytest\n```\n\n# Navigate to the tests directory\n``` bash\n# Navigate to tests directory\ncd test\n\n# Run the tests\npytest\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "",
"version": "0.1.2",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7b4a582601de1c85ed90e449eabfdd72c7ccfbe713a0a7ebb129b9637ccb173b",
"md5": "4276a46bfdc8419a68547bedcd815937",
"sha256": "3f36a45022f62e6e982df9717d6642bd34e3a55c0d4b4929134656a86c1e307f"
},
"downloads": -1,
"filename": "datatransformationslibrary-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4276a46bfdc8419a68547bedcd815937",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 3530,
"upload_time": "2023-08-17T13:26:10",
"upload_time_iso_8601": "2023-08-17T13:26:10.643503Z",
"url": "https://files.pythonhosted.org/packages/7b/4a/582601de1c85ed90e449eabfdd72c7ccfbe713a0a7ebb129b9637ccb173b/datatransformationslibrary-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "68f847043a70c7cc8e91cd6a19daf3b898932a3d20b02f7800b4ab60b98828f1",
"md5": "75482c72680252680dc3fc9211e3ed4a",
"sha256": "8ea5669c24540094b731f5c3883a707b41f0c99ac138b4e2a2882fe719a125c0"
},
"downloads": -1,
"filename": "datatransformationslibrary-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "75482c72680252680dc3fc9211e3ed4a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4.0",
"size": 2746,
"upload_time": "2023-08-17T13:26:12",
"upload_time_iso_8601": "2023-08-17T13:26:12.230159Z",
"url": "https://files.pythonhosted.org/packages/68/f8/47043a70c7cc8e91cd6a19daf3b898932a3d20b02f7800b4ab60b98828f1/datatransformationslibrary-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-17 13:26:12",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "datatransformationslibrary"
}