Skip to content

I can not achieve inplace scaling by using sklearn.preprocessing.minmax_scale #27307

Closed
@guanjiesun

Description

Describe the bug

By setting the copy=False, ndarray data has not changed unexpectedly

image

Steps/Code to Reproduce

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sklearn.preprocessing as pre

np.random.seed(10)
data = np.random.randint(1, 10, size=(5, 3))
print(data)
pre.minmax_scale(data, feature_range=(0, 1), axis=0, copy=False)
print(data)

Expected Results

A reasonable explanation about the copy parameter of minmax_scala funciton

Actual Results

There are no warings and errors, just the result is not wrong!

image

Versions

Python dependencies:
      sklearn: 1.3.0
          pip: 23.2.1
   setuptools: 65.5.0
        numpy: 1.25.2
        scipy: 1.11.2
       Cython: None
       pandas: 2.0.3
   matplotlib: 3.7.2
       joblib: 1.3.2
threadpoolctl: 3.2.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions