diff options
author | gfyoung <gfyoung@mit.edu> | 2016-01-13 13:15:21 +0000 |
---|---|---|
committer | gfyoung <gfyoung@mit.edu> | 2016-03-15 15:04:05 +0100 |
commit | 9128ed5198cc8544406467a00824e5fe6791f090 (patch) | |
tree | ca3dc831ff1566a2794e940d1a358a17774fd59b /numpy/lib/tests/test_function_base.py | |
parent | e034b86d1f40af6e15a829d093232febd4a708c3 (diff) | |
download | numpy-9128ed5198cc8544406467a00824e5fe6791f090.tar.gz |
BUG: Fix string copying for np.place
Fixes bug in string copying in np.place
in which replacements strings that were
smaller than their replaced elements
would only partially replace the element
instead of the entire element.
Closes gh-6974.
Addendum: this commit also appears to have
fixed issue with overflow for very large
input arrays.
Closes gh-7207.
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index e04a497c1..945992fc0 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -805,6 +805,11 @@ class TestExtins(TestCase): assert_raises_regex(ValueError, "Cannot insert from an empty array", lambda: place(a, [0, 0, 0, 0, 0, 1, 0], [])) + # See Issue #6974 + a = np.array(['12', '34']) + place(a, [0, 1], '9') + assert_array_equal(a, ['12', '9']) + def test_both(self): a = rand(10) mask = a > 0.5 |