diff options
author | Jostein Bø Fløystad <jostein.floystad@gmail.com> | 2013-07-05 17:35:45 +0200 |
---|---|---|
committer | Jostein Bø Fløystad <jostein.floystad@gmail.com> | 2013-07-05 17:35:45 +0200 |
commit | c6ce294f6feeebcdf67b238564c770387be933a5 (patch) | |
tree | c9ce3f5e42fc0c5b7db8416ccc412bd320eee9ef /numpy/lib/arraypad.py | |
parent | 79188b21dd85e4115195971522be91a2fcb1a9d2 (diff) | |
download | numpy-c6ce294f6feeebcdf67b238564c770387be933a5.tar.gz |
BUG: Allow to pad arrays by zero entries.
np.pad will now accept a pad_width containing zeros. The functionality
was already implemented, but validation of input was too strict.
Diffstat (limited to 'numpy/lib/arraypad.py')
-rw-r--r-- | numpy/lib/arraypad.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/arraypad.py b/numpy/lib/arraypad.py index c80f6f54d..90b5fcfcd 100644 --- a/numpy/lib/arraypad.py +++ b/numpy/lib/arraypad.py @@ -1079,7 +1079,7 @@ def _validate_lengths(narray, number_elements): normshp = _normalize_shape(narray, number_elements) for i in normshp: chk = [1 if x is None else x for x in i] - chk = [1 if x > 0 else -1 for x in chk] + chk = [1 if x >= 0 else -1 for x in chk] if (chk[0] < 0) or (chk[1] < 0): fmt = "%s cannot contain negative values." raise ValueError(fmt % (number_elements,)) |