Skip to main content

Python library to data transformation

Project description

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

  1. Transpose a Matrix (2D Tensor)

    • Function: transpose2d
    • Transposes the axes of a 2D list.
  2. Time Series Windowing

    • Function: window1d
    • Creates sliding windows over a 1D list or NumPy array.
  3. 2D Convolution

    • Function: convolution2d
    • Applies 2D cross-correlation to an input matrix using a kernel.

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:

  Examples
    import numpy as np
    from datatransformtoolbox.crosscorrelation import crosscorrelation
    input_matrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
    kernel = np.array([[1, 0], [0, -1]])
    convolution2d(input_matrix, kernel, stride=1)
    array([[ 1.,  2.],
           [ 4.,  5.]])
    """

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Authors

Johnny Lazo johnny.lazoq@gmail.com

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

datatransformtoolbox-0.1.3.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datatransformtoolbox-0.1.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file datatransformtoolbox-0.1.3.tar.gz.

File metadata

  • Download URL: datatransformtoolbox-0.1.3.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for datatransformtoolbox-0.1.3.tar.gz
Algorithm Hash digest
SHA256 21001f302256d313da18554c53da4059e788a6d2534f32a1d9b452b5219fb85b
MD5 7061d11ebad1cf202161e43d1d88a09d
BLAKE2b-256 56aaed7661dda7fa59dd36c5361f0259c46a8ca8ca5ae3b5adb815150e8414d3

See more details on using hashes here.

File details

Details for the file datatransformtoolbox-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: datatransformtoolbox-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for datatransformtoolbox-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fb076fbd2c06271ea63e910b59d83b400531cb44a8ec7571cdbde409cf53c5ca
MD5 2a2b7b9ec12a3a1db84e8932cbc241fd
BLAKE2b-256 55ffc5bbe7c331c74e47b409a7ae744dbcd682bade3ca7dc1d9e513c02ff080c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page