checkbounds(Bool, [1,2,3], 0)
reduce
function.
op
, but that only seems to have to parameters.
reduce((x, y) -> string(x, y), ["A", "B", "C"])
, but would like to have the output to be "1A2B3C"
.
reduce((x, y, i) -> string(x, y), ["A", "B", "C"])
but I get no method matching (::getfield(Main, Symbol("##51#52")))(::String, ::String)
. (Which I don’t understand)
reduce((acc, (n, item)) -> string(acc, n, item), enumerate(["A", "B", "C"]); init = "")
?
reshape
docs:help?> reshape
search: reshape promote_shape
reshape(A, dims...) -> AbstractArray
reshape(A, dims) -> AbstractArray
Return an array with the same data as A, but with different dimension sizes or number of dimensions. The two arrays share the
same underlying data, so that the result is mutable if and only if A is mutable, and setting elements of one alters the
values of the other.
The new dimensions may be specified either as a list of arguments or as a shape tuple. At most one dimension may be specified
with a :, in which case its length is computed such that its product with all the specified dimensions is equal to the length
of the original array A. The total number of elements must not change.
Examples
≡≡≡≡≡≡≡≡≡≡
julia> A = Vector(1:16)
16-element Vector{Int64}:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
julia> reshape(A, (4, 4))
4×4 Matrix{Int64}:
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
julia> reshape(A, 2, :)
2×8 Matrix{Int64}:
1 3 5 7 9 11 13 15
2 4 6 8 10 12 14 16
julia> reshape(1:6, 2, 3)
2×3 reshape(::UnitRange{Int64}, 2, 3) with eltype Int64:
1 3 5
2 4 6
:
is for not specifying a dimension's size
Array{NamedTuple}
but that produces an error because it seems check for the symbols that are part of the named tuple. I also tried Array{NamedTuple{Any}}
but a similar thing happened.