summaryrefslogtreecommitdiff
path: root/numpy/core/multiarray.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2020-04-30 19:50:44 -0500
committerSebastian Berg <sebastian@sipsolutions.net>2020-09-02 20:11:21 -0500
commitcfd553dad7c1f315b7508eb56ac4527afc444ebb (patch)
tree77f50e201acf4ecebc66b008a35726a835cccf94 /numpy/core/multiarray.py
parente3c84a44b68966ab887a3623a0ff57169e508deb (diff)
downloadnumpy-cfd553dad7c1f315b7508eb56ac4527afc444ebb.tar.gz
ENH: Implement concatenate dtype and casting keyword arguments
Unfortunately, the casting was not consistent and sometimes used force casting (axis=None) while normally same kind casting was used. This thus deprecates the `force_casting` corner case, so that casting has to be provided in the future.
Diffstat (limited to 'numpy/core/multiarray.py')
-rw-r--r--numpy/core/multiarray.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/numpy/core/multiarray.py b/numpy/core/multiarray.py
index 10325050d..540c0568f 100644
--- a/numpy/core/multiarray.py
+++ b/numpy/core/multiarray.py
@@ -141,9 +141,9 @@ def empty_like(prototype, dtype=None, order=None, subok=None, shape=None):
@array_function_from_c_func_and_dispatcher(_multiarray_umath.concatenate)
-def concatenate(arrays, axis=None, out=None):
+def concatenate(arrays, axis=None, out=None, dtype=None, casting=None):
"""
- concatenate((a1, a2, ...), axis=0, out=None)
+ concatenate((a1, a2, ...), axis=0, out=None, dtype=None, casting="same_kind")
Join a sequence of arrays along an existing axis.
@@ -159,6 +159,16 @@ def concatenate(arrays, axis=None, out=None):
If provided, the destination to place the result. The shape must be
correct, matching that of what concatenate would have returned if no
out argument were specified.
+ dtype : str or dtype
+ If provided, the destination array will have this dtype. Cannot be
+ provided together with `out`.
+
+ ..versionadded:: 1.19.0
+
+ casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
+ Controls what kind of data casting may occur. Defaults to 'same_kind'.
+
+ ..versionadded:: 1.19.0
Returns
-------