Skip to main content

Implementation of three functions used in data transformation: matrix transpose, time series windowing and cross-correlation.

Project description

Data Trans Functions

Description

The data-trans-functions package provides utility functions to perform operations on 2D matrices and 1D arrays. With features like 2D matrix transposition, 1D windowing, and 2D convolution, it simplifies common operations while ensuring type safety.

Features

  • transpose2d: Transposes a 2D matrix, effectively switching its axes.
  • window1d: Generates a series of 1D sliding windows from an input array.
  • convolution2d: Computes the 2D convolution of an input matrix using a given kernel.

Installation

To install the package via pip, run: pip install data-trans-functions

Usage

Here are brief examples for each function:

from data_trans_functions import transpose2d, window1d, convolution2d
import numpy as np

# Using transpose2d:
matrix = [[1, 2, 3], [4, 5, 6]]
print(transpose2d(matrix))  # Returns: [[1, 4], [2, 5], [3, 6]]

# Using window1d:
arr = [1, 2, 3, 4]
print(window1d(arr, 2, shift=2))  # Returns: [[1, 2], [3, 4]]

# Using convolution2d:
input_matrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
kernel = np.array([[1, 0], [0, -1]])
print(convolution2d(input_matrix, kernel))  # Returns: [[3, 2], [3, 2]]

Recommendations

It's recommended to use these functions in combination with a type checker like mypy for safer usage.

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

data_trans_functions-1.0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

data_trans_functions-1.0.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file data_trans_functions-1.0.0.tar.gz.

File metadata

  • Download URL: data_trans_functions-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.9 Linux/6.2.0-26-generic

File hashes

Hashes for data_trans_functions-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4bd044003dc9c6175d3a2b11fe1f6fad752d302c0bee60a4f5ff8293583fa76b
MD5 f0e5c0604d4c0a74c3aac0cf63b5b32e
BLAKE2b-256 863824485fcf3b56911bacd2a29edff6470696a807fe6d4e5cd1ea24a39800b4

See more details on using hashes here.

File details

Details for the file data_trans_functions-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: data_trans_functions-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.9 Linux/6.2.0-26-generic

File hashes

Hashes for data_trans_functions-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd9dc67245f73b4ba443aca53067661070dbfa26c8f32f48c6dd8a5fbf2a5726
MD5 36f2af981f90c63f69a8ec2f832edea2
BLAKE2b-256 dec7eaad48ef73b9c1b8366ba64323260aacef63edcd9f78e654b2d55195dd37

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