data_transformation_tc is a Python library designed to streamline common data transformations required in machine learning and data science workflows, such as transpose a matrix, create time series windows, or apply 2D convolution
Project description
data_transformation_tc
Overview
data_transformation_tc is a Python library designed to streamline common data transformations required in machine learning and data science workflows, such as transpose a matrix, create time series windows, or apply 2D convolution.
Features
- Transpose: Quickly transpose any 2D matrix with the transpose2d function.
- Time Series Windowing: Generate windows for your 1D data arrays or lists with the window1d function. Customize window size, shift, and stride as per your needs.
- 2D Convolution: Apply 2D convolution on matrices using the convolution2d function. This function computes the cross-correlation of an input matrix with a specified kernel.
Installation
To install the data_transforms package, use pip:
pip install data-transformation-tc
Usage
A quick example to get you started:
from data_transformation_tc import transpose2d, window1d, convolution2d
import numpy as np
# Transpose a matrix
matrix = [
[1.0, 2.0, 3.0],
[4.0, 5.0, 6.0],
[7.0, 8.0, 9.0]
]
transposed_matrix = transpose2d(matrix)
print(transposed_matrix)
# Create time series windows
input_data = [1.0, 2.0, 3.0, 4.0, 5.0]
windows = window1d(input_data, size=3, shift=1, stride=2)
print(windows)
# Apply 2D convolution
input_matrix = np.array([
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
])
kernel = np.array([
[1, 0],
[0, -1]
])
conv_result = convolution2d(input_matrix, kernel)
print(conv_result)
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
Close
Hashes for data-transformation-tc-0.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d704bdd9a31baee2a1a8c1bb8c0ab668a68db9b49f0cd79a7c32f4e009d43e3 |
|
MD5 | 241a956f992f92a2bceb36cef03e2130 |
|
BLAKE2b-256 | bcba77aab3e9b8ab2f515792cdfc2d383bb3e5639c7a0b5c62a7e6027e9ecf21 |
Close
Hashes for data_transformation_tc-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 495753813e21369b7294fd9408231c19fca3ba348bfd9f0398d0aaa930cd1429 |
|
MD5 | 972d6baadd031f506b87e1d7c522e898 |
|
BLAKE2b-256 | 5d585442a6928748bf86430ece01bfc44aa41bd70470666a8b83d055772d3a0b |