Data Transformation Library
The Data Transformation Library is a Python library that provides a set of functions for common data transformation tasks. It contains simple function to make their every day coding easier.
Features
-
Transpose a Matrix (2D Tensor)
- Function:
transpose2d - Transposes the axes of a 2D list.
- Function:
-
Time Series Windowing
- Function:
window1d - Creates sliding windows over a 1D list or NumPy array.
- Function:
-
2D Convolution
- Function:
convolution2d - Applies 2D cross-correlation to an input matrix using a kernel.
- Function:
Installation
You can install the package using pip:
pip install datatransformtoolbox
or
poetry add datatransformtoolbox
Usage
Here is a simple example of how to use transpose library:
import numpy as np
from datatransformtoolbox.transpose import transpose2d
matrix = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
transposed_matrix = transpose2d(matrix)
print(transposed_matrix)
# Output: [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
Another simple example of how to use Time series Windowing library:
import numpy as np
from datatransformtoolbox.window import window1
input_array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
size = 2
shift = 1
stride = 1
# Call the function
windows = window1d(input_array, size, shift, stride)
# Print the results
print("Generated windows:")
for i, window in enumerate(windows):
print(f"Window {i+1}: {window}")
# Example output:
#Generated windows:
#Window 1: [1 2]
#Window 2: [2 3]
#Window 3: [3 4]
#Window 4: [4 5]
#Window 5: [5 6]
#Window 6: [6 7]
#Window 7: [7 8]
#Window 8: [8 9]
#Window 9: [ 9 10]
Another simple example of how to use Cross-Correlation library:
import numpy as np
from datatransformtoolbox.crosscorrelation import convolution2d
# Define the input matrix and kernel
input_matrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
kernel = np.array([[1, 0], [0, -1]])
# Perform the 2D convolution with a stride of 1
result = convolution2d(input_matrix, kernel, stride=1)
# Print the result
print(result)
#Output
#[[-4. -4.]
# [-4. -4.]]
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Authors
Johnny Lazo johnny.lazoq@gmail.com
Metadata
Release files for datatransformtoolbox 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| datatransformtoolbox-0.1.5.tar.gz | 7.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datatransformtoolbox-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.4 kB
Release files / datatransformtoolbox-0.1.5.tar.gz
| Download URL | datatransformtoolbox-0.1.5.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1d20d3a87ffebd510f8e1811aa6dad6249d362bf425226ad6821c6b760765a7
|
|
BLAKE2b-256 checksum How to use checksums |
1a32d67560938f80fd0ac7a43ee7aa9bcb38f245b857fd7c753c634da0232dc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2
|
Release files / datatransformtoolbox-0.1.5-py3-none-any.whl
| Download URL | datatransformtoolbox-0.1.5-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d2905ce8af203f51bbc36842f5c4b55dcee14461ecf0897f1f6ef37344ace361
|
|
BLAKE2b-256 checksum How to use checksums |
1e120d366c97560e7e1b158ab39b6278d15af83216a7ef1ae4258f24aae0a9c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2
|