No project description provided
Project description
Overview
This project contains a collection of functions for performing various data transformation and analysis tasks, including matrix transposition, window generation from 1D arrays, and 2D convolution operations.
Project Structure
src/
data_transformation/
__init__.py
transform.py
test/
test_functions.py
poetry.lock
pyproject.toml
README.md
Installation
This project uses Poetry for dependency management. To install the required dependencies, run the following command:
poetry install
Usage
Transposing a 2D Matrix
To transpose a 2D matrix, use the transpose2d function from src/data_transformation/transform.py.
from data_transformation.transform import transpose2d
matrix = [[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]
transposed_matrix = transpose2d(matrix)
print(transposed_matrix)
Generating Windows from a 1D Array
To generate windows from a 1D array, use the window1d function from src/data_transformation/transform.py.
from data_transformation.transform import window1d
array = [1, 2, 3, 4, 5]
windows = window1d(array, size=2, shift=1, stride=1)
print(windows)
Applying 2D Convolution
To apply a 2D convolution operation, use the convolution2d function from src/data_transformation/transform.py.
import numpy as np
from data_transformation.transform import convolution2d
input_matrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
kernel = np.array([[1, 0], [0, -1]])
convolved_matrix = convolution2d(input_matrix, kernel)
print(convolved_matrix)
Running Tests
To run the tests, use the following command:
poetry run python -m unittest tests/test_functions.py
Project details
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 mjurav_de2_1-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9250ee555231134275932867578558d0ec1b90e994bcfa19b3897000463be308 |
|
MD5 | 41444201994fa866248ba3d84e786f39 |
|
BLAKE2b-256 | 2e8d6ada8307ddb34b3221ae0e586b625f7ddf394295b1469ceea34426fd7418 |