Skip to content

Commit 0489082

Browse files
DOC: added Notes section to document mixed dtype effect on np.append [skip azp][skip cirrus][skip actions]
1 parent c016301 commit 0489082

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

numpy/lib/_function_base_impl.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5715,10 +5715,7 @@ def append(arr, values, axis=None):
57155715
These values are appended to a copy of `arr`. It must be of the
57165716
correct shape (the same shape as `arr`, excluding `axis`). If
57175717
`axis` is not specified, `values` can be any shape and will be
5718-
flattened before use. If dtype of `values` is different from the
5719-
dtype of `arr` then their dtypes are compared to figure out the
5720-
common dtype they can both be safely coerced to. For e.g. `int64`
5721-
and `float64` can both go to `float64`.
5718+
flattened before use.
57225719
axis : int, optional
57235720
The axis along which `values` are appended. If `axis` is not
57245721
given, both `arr` and `values` are flattened before use.
@@ -5735,6 +5732,13 @@ def append(arr, values, axis=None):
57355732
insert : Insert elements into an array.
57365733
delete : Delete elements from an array.
57375734
5735+
Notes
5736+
-----
5737+
If dtype of `values` is different from the dtype of `arr` then
5738+
their dtypes are compared to figure out the common dtype they can
5739+
both be safely coerced to. For e.g. `int64` and `float64` can both
5740+
go to `float64`. See examples section below.
5741+
57385742
Examples
57395743
--------
57405744
>>> np.append([1, 2, 3], [[4, 5, 6], [7, 8, 9]])

0 commit comments

Comments
 (0)