@@ -235,7 +235,9 @@ def vstack(tup, *, dtype=None, casting="same_kind"):
235
235
----------
236
236
tup : sequence of ndarrays
237
237
The arrays must have the same shape along all but the first axis.
238
- 1-D arrays must have the same length.
238
+ 1-D arrays must have the same length. In the case of a single
239
+ array_like input, it will be treated as a sequence of arrays; i.e.,
240
+ each element along the zeroth axis is treated as a separate array.
239
241
240
242
dtype : str or dtype
241
243
If provided, the destination array will have this dtype. Cannot be
@@ -308,7 +310,9 @@ def hstack(tup, *, dtype=None, casting="same_kind"):
308
310
----------
309
311
tup : sequence of ndarrays
310
312
The arrays must have the same shape along all but the second axis,
311
- except 1-D arrays which can be any length.
313
+ except 1-D arrays which can be any length. In the case of a single
314
+ array_like input, it will be treated as a sequence of arrays; i.e.,
315
+ each element along the zeroth axis is treated as a separate array.
312
316
313
317
dtype : str or dtype
314
318
If provided, the destination array will have this dtype. Cannot be
@@ -384,8 +388,10 @@ def stack(arrays, axis=0, out=None, *, dtype=None, casting="same_kind"):
384
388
385
389
Parameters
386
390
----------
387
- arrays : sequence of array_like
388
- Each array must have the same shape.
391
+ arrays : sequence of ndarrays
392
+ Each array must have the same shape. In the case of a single ndarray
393
+ array_like input, it will be treated as a sequence of arrays; i.e.,
394
+ each element along the zeroth axis is treated as a separate array.
389
395
390
396
axis : int, optional
391
397
The axis in the result array along which the input arrays are stacked.
0 commit comments