We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f34dac4 commit 5254479Copy full SHA for 5254479
numpy/_core/shape_base.py
@@ -60,18 +60,18 @@ def atleast_1d(*arys):
60
(array([1]), array([3, 4]))
61
62
"""
63
+ if len(arys) == 1:
64
+ result = asanyarray(arys[0])
65
+ if result.ndim == 0:
66
+ result = result.reshape(1)
67
+ return result
68
res = []
69
for ary in arys:
- ary = asanyarray(ary)
- if ary.ndim == 0:
- result = ary.reshape(1)
- else:
- result = ary
70
+ result = asanyarray(ary)
71
72
73
res.append(result)
- if len(res) == 1:
- return res[0]
74
- return tuple(res)
+ return res
75
76
77
def _atleast_2d_dispatcher(*arys):
0 commit comments