From 2599a4c569dbdeb3cd2f3d6da3502886a4333fda Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Fri, 9 Jul 2021 21:36:27 +0200 Subject: [PATCH] DOC: broadcast_to() supports int as shape parameter --- numpy/lib/stride_tricks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/numpy/lib/stride_tricks.py b/numpy/lib/stride_tricks.py index 82c8a57c884b..5093993a9e92 100644 --- a/numpy/lib/stride_tricks.py +++ b/numpy/lib/stride_tricks.py @@ -371,8 +371,9 @@ def broadcast_to(array, shape, subok=False): ---------- array : array_like The array to broadcast. - shape : tuple - The shape of the desired array. + shape : tuple or int + The shape of the desired array. A single integer ``i`` is interpreted + as ``(i,)``. subok : bool, optional If True, then sub-classes will be passed-through, otherwise the returned array will be forced to be a base-class array (default).