8000 np.rescale: remove redundant out= argument · numpy/numpy@967809c · GitHub
[go: up one dir, main page]

Skip to content

Commit 967809c

Browse files
committed
np.rescale: remove redundant out= argument
1 parent c37e546 commit 967809c

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

numpy/lib/function_base.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4401,7 +4401,7 @@ def append(arr, values, axis=None):
44014401

44024402

44034403
def rescale(arr, out_min=0, out_max=1, in_min=None, in_max=None,
4404-
axis=None, return_params=False, out=None):
4404+
axis=None, return_params=False):
44054405
"""Linearly scale non-NaN values in array to the specified interval.
44064406
44074407
.. versionadded:: 1.15.0
@@ -4431,8 +4431,6 @@ def rescale(arr, out_min=0, out_max=1, in_min=None, in_max=None,
44314431
If True, also return `offset` and `scale` parameters so that
44324432
``offset + scale * x`` maps ``x`` from input interval onto
44334433
output interval.
4434-
out : array_like, optional
4435-
Array of the same shape as `arr`, in which to store the result.
44364434
44374435
Returns
44384436
-------
@@ -4483,11 +4481,6 @@ def rescale(arr, out_min=0, out_max=1, in_min=None, in_max=None,
44834481

44844482
res = arr * scale + offset
44854483

4486-
if out is None:
4487-
out = res
4488-
else:
4489-
out[...] = res
4490-
44914484
if return_params:
4492-
return out, offset, scale
4493-
return out
4485+
return res, offset, scale
4486+
return res

numpy/lib/tests/test_function_base.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3030,11 +3030,6 @@ def test_return_params(self):
30303030
assert_equal(offset, np.c_[0, -2/3].T)
30313031
assert_equal(scale, np.c_[1/3, 1/3].T)
30323032

3033-
def test_out(self):
3034-
out = np.zeros_like(self.arr)
3035-
assert_equal(rescale(self.arr, self.arr.min(), self.arr.max(), out=out),
3036-
self.arr)
3037-
30383033
def test_nan(self):
30393034
arr = np.array([[1, 2],
30403035
[1, 1]])

0 commit comments

Comments
 (0)
0