Skip to content

Commit 6132b98

Browse files
committed
Merge pull request numpy#4034 from endolith/patch-1
DOC: Change pad mode options to a definition list
2 parents 96dd69c + f325c34 commit 6132b98

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

numpy/lib/arraypad.py

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,27 +1108,38 @@ def pad(array, pad_width, mode=None, **kwargs):
11081108
mode : {str, function}
11091109
One of the following string values or a user supplied function.
11101110
1111-
'constant' Pads with a constant value.
1112-
'edge' Pads with the edge values of array.
1113-
'linear_ramp' Pads with the linear ramp between end_value and the
1114-
array edge value.
1115-
'maximum' Pads with the maximum value of all or part of the
1116-
vector along each axis.
1117-
'mean' Pads with the mean value of all or part of the
1118-
vector along each axis.
1119-
'median' Pads with the median value of all or part of the
1120-
vector along each axis.
1121-
'minimum' Pads with the minimum value of all or part of the
1122-
vector along each axis.
1123-
'reflect' Pads with the reflection of the vector mirrored on
1124-
the first and last values of the vector along each
1125-
axis.
1126-
'symmetric' Pads with the reflection of the vector mirrored
1127-
along the edge of the array.
1128-
'wrap' Pads with the wrap of the vector along the axis.
1129-
The first values are used to pad the end and the
1130-
end values are used to pad the beginning.
1131-
<function> Padding function, see Notes.
1111+
'constant'
1112+
Pads with a constant value.
1113+
'edge'
1114+
Pads with the edge values of array.
1115+
'linear_ramp'
1116+
Pads with the linear ramp between end_value and the
1117+
array edge value.
1118+
'maximum'
1119+
Pads with the maximum value of all or part of the
1120+
vector along each axis.
1121+
'mean'
1122+
Pads with the mean value of all or part of the
1123+
vector along each axis.
1124+
'median'
1125+
Pads with the median value of all or part of the
1126+
vector along each axis.
1127+
'minimum'
1128+
Pads with the minimum value of all or part of the
1129+
vector along each axis.
1130+
'reflect'
1131+
Pads with the reflection of the vector mirrored on
1132+
the first and last values of the vector along each
1133+
axis.
1134+
'symmetric'
1135+
Pads with the reflection of the vector mirrored
1136+
along the edge of the array.
1137+
'wrap'
1138+
Pads with the wrap of the vector along the axis.
1139+
The first values are used to pad the end and the
1140+
end values are used to pad the beginning.
1141+
<function>
1142+
Padding function, see Notes.
11321143
stat_length : {sequence, int}, optional
11331144
Used in 'maximum', 'mean', 'median', and 'minimum'. Number of
11341145
values at edge of each axis used to calculate the statistic value.
@@ -1194,7 +1205,7 @@ def pad(array, pad_width, mode=None, **kwargs):
11941205
11951206
The padding function, if used, should return a rank 1 array equal in
11961207
length to the vector argument with padded values replaced. It has the
1197-
following signature:
1208+
following signature::
11981209
11991210
padding_func(vector, iaxis_pad_width, iaxis, **kwargs)
12001211
@@ -1275,7 +1286,6 @@ def pad(array, pad_width, mode=None, **kwargs):
12751286
[10, 10, 3, 4, 5, 10, 10],
12761287
[10, 10, 10, 10, 10, 10, 10],
12771288
[10, 10, 10, 10, 10, 10, 10]])
1278-
12791289
"""
12801290

12811291
narray = np.array(array)

0 commit comments

Comments
 (0)