Skip to main content

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


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)

Uploaded Source

Built Distribution

arrayscaler-0.1.1-py3-none-any.whl (2.4 kB view hashes)

Uploaded Python 3

Supported by

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