Looking at the Python Numpy docs this needs to be defined as:
atleast_2d(a) = fill(a,1,1)
atleast_2d(a::AbstractArray) = ndims(a) == 1 ? reshape(a, :, 1) : a
Testing:
julia> atleast_2d(3)
1×1 Matrix{Int64}:
3
julia> atleast_2d([4,5])
2×1 Matrix{Int64}:
4
5
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…