Getting parent array of a specified array in Julia - parent() Method Last Updated : 26 Mar, 2020 Comments Improve Suggest changes Like Article Like Report 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 array view type (i.e, SubArray) or the array itself if it is not a view. Example 1: Python # Julia program to illustrate # the use of Array parent() method # Getting the parent array of the # specified 1D array view type (i.e, SubArray) # or the array itself if it is not a view. A = [1, 2, 3, 4]; B = view(A, 2) println(parent(B)) # Getting the parent array of the # specified 2D array view type (i.e, SubArray) # or the array itself if it is not a view. C = [1 2; 3 4]; D = view(C, 1:2,: ) println(parent(D)) Output: Example 2: Python # Julia program to illustrate # the use of Array parent() method # Getting the parent array of the # specified 1D array view type (i.e, SubArray) # or the array itself if it is not a view. A = [1, 2, 3, 4]; println(parent(A)) # Getting the parent array of the # specified 2D array view type (i.e, SubArray) # or the array itself if it is not a view. B = [1 2; 3 4]; println(parent(B)) # Getting the parent array of the # specified 3D array view type (i.e, SubArray) # or the array itself if it is not a view. C = cat([1 2; 3 4], [5 6; 7 8], [2 2; 3 4], dims = 3); println(parent(C)) Output: Comment More infoAdvertise with us Next Article Getting parent array of a specified array in Julia - parent() Method K Kanchan_Ray Follow Improve Article Tags : Julia Similar Reads Creating a view of parent array in Julia - view(), @view and @views Methods The view() is an inbuilt function in julia which is used to return a view into the given parent array A with the given indices instead of making a copy. Syntax: view(A, inds...) Parameters: A: Specified parent array. inds: Specified indices. Returns: It returns a view into the given parent array A w 2 min read Creating a similar type of array in Julia - similar() Method The similar() is an inbuilt function in julia which is used to create an uninitialized mutable array with the given element type and size, based upon the given source array. Syntax: similar(array, element_type=eltype(array), dims=size(array)) Parameters: array: Specified arrays. element_type: Specif 1 min read Getting key value pairs of a dictionary in Julia - pairs() Method The pairs() is an inbuilt function in julia which is used to return an iterator over key=>value pairs for the specified collection that maps a set of keys to a set of values. This includes arrays, where the keys are the array indices. Syntax: pairs(collection) or pairs(IndexStyle(A), A) Parameter 1 min read 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 Getting data type of elements in Julia - typeof() Method The typeof() is an inbuilt function in julia which is used to return the concrete type of the specified elements. Syntax: typeof(x) Parameters: x: Specified element. Returns: It returns the concrete type of the specified elements. Example 1: Python # Julia program to illustrate # the use of typeof() 1 min read Like