Get dimensions of array in Julia - ndims() Method Last Updated : 12 Jul, 2025 Comments Improve Suggest changes Like Article Like Report 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 # the use of Array ndims() method # Finding the number of dimension of # the specified array A. A = fill(1, 3); println(ndims(A)) # Finding the number of dimension of # the specified array B. B = fill(1, (3, 3)); println(ndims(B)) # Finding the number of dimension of # the specified array C. C = fill(1, (3, 1, 2)); println(ndims(C)) Output: Example 2: Python # Julia program to illustrate # the use of Array ndims() method # Finding the number of dimension of # the specified array A. A = fill(1, 2, 3, 4); println(ndims(A)) # Finding the number of dimension of # the specified array B. B = fill((5, 10), (3, 3)); println(ndims(B)) # Finding the number of dimension of # the specified array C. C = fill((5, 10, 15), (3, 1, 2)); println(ndims(C)) Output: Create Quiz Comment K Kanchan_Ray Follow 0 Improve K Kanchan_Ray Follow 0 Improve Article Tags : Julia Explore DSA Tutorial - Learn Data Structures and Algorithms 6 min read System Design Tutorial 3 min read Aptitude Questions and Answers 3 min read Web Development Technologies 6 min read AI, ML and Data Science Tutorial 3 min read DevOps Tutorial 5 min read Like