A simple python code for Scale arrays
Project description
ARRAY SCALER
Introduction
A simple python tool for scaling and rescaling arrays:
Installation
To install Array Scaler, run the following command:
pip install -e '.[lint, test]'
Usage
Here is a simple example of how to use Array Scaler:
from arrayscaler.arrayscaler import ScalingHelper
import numpy as np
# Scaling integers (5) with a lower limit of 0 and upper limit of 10
print(ScalingHelper.scale(5, 0, 10))
# Scaling numpy array
print(ScalingHelper.scale(np.array([1,3,4,5,3,2]), 0, 2))
# Rescaling the scaled numpy array
print(ScalingHelper.rescale(ScalingHelper.scale(np.array([1,3,4,5,3,2]), 0, 2), 0, 2))
The scale
method will scale the input array to a range of 0 to 1. The rescale
method will rescale the scaled array back to its original range.
Contributing
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
arrayscaler-0.1.1.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for arrayscaler-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df48f3dc7e389b50381d330492031ae8d12319bfc0272c1e0e6d3a7c3ea51ec3 |
|
MD5 | de6afad4da09c9090f9d177c20b27704 |
|
BLAKE2b-256 | 8ced7e724269ae3b5a2c4d48447f8078a34dd967e804f5346e0799d61483904d |