
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
data-trans-lib
Advanced tools
This python library consists of 3 common data transformation functions:
You can install this package using pip:
pip install data-trans-lib
This library is supported on Python 3.9 and above.
Transposes a 2-D list - switches rows and columns.
Parameters: input_matrix - is a list of lists of real numbers to transpose.
from data_trans_lib.transformations import transpose2d
input_matrix = [[1.0, 2.0, 3.0],
[4.0, 5.0, 6.0]]
transposed_matrix = transpose2d(input_matrix)
# Output:
# [[1.0, 4.0],
# [2.0, 5.0],
# [3.0, 6.0]]
Extracts specified size windows from a 1D list or numpy array. The shift for the starting position of the window and the stride between consecutive windows could be specified.
Parameters: input_array - is a list or 1D Numpy array of real numbers from which windows are extracted. size - is a positive integer that determines the size (length) of the window. shift is a positive integer that determines the shift (step size) between different windows. stride is a positive integer that determines the stride (step size) within each window. Default shift and stride values equals to .
from data_trans_lib.transformations import window1d
input_array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
size = 3
shift = 2
stride = 2
windows = window1d(input_array, size, shift, stride)
# Output:
# [[1, 3, 5],
# [3, 5, 7],
# [5, 7, 9]]
Performs 2D convolution between the input matrix and the kernel with the specified stride, and it returns the resulting 2D NumPy array. The convolution operation is implemented by sliding the kernel over the input matrix with the specified stride and computing the element-wise multiplication and summation.
Parameters: input_matrix - is a 2D Numpy array of real numbers to convolve. kernel - is a 2D Numpy array of real numbers. stride is a positive integer that determines the stride (step size) within each window. Default stride value equals to 1.
import numpy as np
from data_trans_lib.transformations import convolution2d
input_matrix = np.array([[0, 1, 2], [3, 4, 5], [6, 7, 8]])
kernel = np.array([[0, 1], [1, 0]])
convolution = convolution2d(input_matrix, kernel)
# Output:
# [[ 4, 6],
# [10, 12]
FAQs
Unknown package
We found that data-trans-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.