Representing the dimensions of array in Julia - Dims() Method Last Updated : 12 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The Dims() is an inbuilt function in julia which is used to represent the dimensions of the specified AbstractArray. Syntax: Dims(A) Parameters: A: Specified array Returns: It returns the represented dimensions of the specified AbstractArray. Example 1: Python # Julia program to illustrate # the use of Dims() method # Getting the represented dimensions # of the specified AbstractArray. A = [1, 2, 3, 4] println(Dims(A)) B = (5, 10, 15, 20) println(Dims(B)) Output: (1, 2, 3, 4) (5, 10, 15, 20) Example 2: Python # Julia program to illustrate # the use of Dims() method # Getting the represented dimensions # of the specified AbstractArray. A = [1 2 3; 4 5 6] println(Dims(A)) B = cat([1 2; 3 4], [5 6; 7 8], [2 2; 3 4], dims = 3) println(Dims(B)) Output: Comment More infoAdvertise with us Next Article Get dimensions of array in Julia - ndims() Method K Kanchan_Ray Follow Improve Article Tags : Julia Similar Reads Reshaping array dimensions in Julia | Array reshape() Method The reshape() is an inbuilt function in julia which is used to return an array with the same data as the specified array, but with different specified dimension sizes. Syntax: reshape(A, dims) Parameters: A: Specified array. dims: Specified dimension. Returns: It returns an array with the same data 2 min read Get dimensions of array in Julia - ndims() Method The ndims() is an inbuilt function in julia which is used to return the number of dimension of the specified array A. Syntax: ndims(A::AbstractArray) Parameters: A: Specified array Returns: It returns the number of dimension of the specified array A. Example 1: Python # Julia program to illustrate # 1 min read Get array dimensions and size of a dimension in Julia - size() Method The size() is an inbuilt function in julia which is used to return a tuple containing the dimensions of the specified array. This returned tuple format is (a, b, c) where a is the rows, b is the columns and c is the height of the array. Syntax: size(A::AbstractArray) or size(A::AbstractArray, Dim) P 2 min read Set elements at a given index of array in Julia - setindex!() Method The setindex!() is an inbuilt function in julia which is used to store values from the given array X within some subset of A as specified by inds. Syntax: setindex!(A, X, inds...) Parameters: A: Specified function.X: Specified array.inds: Specified index. Returns: It does not return any values. 1 min read Creating array with repeated elements in Julia - repeat() Method The repeat() is an inbuilt function in julia which is used to construct an array by repeating the specified array elements with the specified number of times. Syntax: repeat(A::AbstractArray, counts::Integer...) or repeat(A::AbstractArray; inner, outer) or repeat(s::AbstractString, r::Integer) or re 2 min read Getting parent array of a specified array in Julia - parent() Method The parent() is an inbuilt function in julia which is used to return the parent array of a specified array view type (i.e, SubArray) or the array itself if it is not a view. Syntax: parent(A) Parameters: A: Specified array or an array view type. Returns: It returns the parent array of a specified ar 2 min read Like