diff options
author | Gregory R. Lee <grlee77@gmail.com> | 2019-03-25 15:23:46 -0400 |
---|---|---|
committer | Matti Picus <matti.picus@gmail.com> | 2019-03-25 21:23:46 +0200 |
commit | d6dcaedad22f5842e28179351238b4847e74d5a9 (patch) | |
tree | 1aa9c4d1fdcdb80ad6a9af64e684a7842daee126 /numpy/lib/arraypad.py | |
parent | 81f0ddac64919e503beeea2c1812b36a607de55d (diff) | |
download | numpy-d6dcaedad22f5842e28179351238b4847e74d5a9.tar.gz |
DOC: correction to numpy.pad docstring (#13149)
* DOC: fix mistatement in numpy.pad docstring
Diffstat (limited to 'numpy/lib/arraypad.py')
-rw-r--r-- | numpy/lib/arraypad.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/numpy/lib/arraypad.py b/numpy/lib/arraypad.py index 570f86969..07146f404 100644 --- a/numpy/lib/arraypad.py +++ b/numpy/lib/arraypad.py @@ -694,9 +694,8 @@ def pad(array, pad_width, mode='constant', **kwargs): think about with a rank 2 array where the corners of the padded array are calculated by using padded values from the first axis. - The padding function, if used, should return a rank 1 array equal in - length to the vector argument with padded values replaced. It has the - following signature:: + The padding function, if used, should modify a rank 1 array in-place. It + has the following signature:: padding_func(vector, iaxis_pad_width, iaxis, kwargs) @@ -704,7 +703,7 @@ def pad(array, pad_width, mode='constant', **kwargs): vector : ndarray A rank 1 array already padded with zeros. Padded values are - vector[:pad_tuple[0]] and vector[-pad_tuple[1]:]. + vector[:iaxis_pad_width[0]] and vector[-iaxis_pad_width[1]:]. iaxis_pad_width : tuple A 2-tuple of ints, iaxis_pad_width[0] represents the number of values padded at the beginning of vector where @@ -766,7 +765,6 @@ def pad(array, pad_width, mode='constant', **kwargs): ... pad_value = kwargs.get('padder', 10) ... vector[:pad_width[0]] = pad_value ... vector[-pad_width[1]:] = pad_value - ... return vector >>> a = np.arange(6) >>> a = a.reshape((2, 3)) >>> np.pad(a, 2, pad_with) |