minmax_scaling
minmax_scaling(array, columns, min_val=0, max_val=1)
In max scaling of pandas DataFrames.
Parameters
-
array
: pandas DataFrame or NumPy ndarray, shape = [n_rows, n_columns]. -
columns
: array-like, shape = [n_columns]Array-like with column names, e.g., ['col1', 'col2', ...] or column indices [0, 2, 4, ...]
-
min_val
:int
orfloat
, optional (default=0
)minimum value after rescaling.
-
max_val
:int
orfloat
, optional (default=1
)maximum value after rescaling.
Returns
-
df_new
: pandas DataFrame object.Copy of the array or DataFrame with rescaled columns.
Examples
For usage examples, please see
[http://jaisenbe58r.github.io/mlearner/user_guide/preprocessing/minmax_scaling/.](http://jaisenbe58r.github.io/mlearner/user_guide/preprocessing/minmax_scaling/.)
adapted from
https://github.com/rasbt/mlxtend/blob/master/mlxtend/preprocessing/scaling.py
Author: Sebastian Raschka <sebastianraschka.com>
License: BSD 3 clause