Get all array elements with true values in Julia | Array findall() Method Last Updated : 23 Mar, 2020 Comments Improve Suggest changes Like Article Like Report The findall() is an inbuilt function in julia which is used to return a vector of indices or keys of the all true values from the specified array A. If such true values are not present in the array, return an empty array. Here values of index or key start from 1 i.e, for index of 1st element is 1, index of 2nd element is 2 and so on. Syntax: findall(A) or findall(f::Function, A) Parameters: A: Specified array Function: Determines whether something is true or false based on the specified arguments Returns: It returns a vector of indices or keys of the all true values from the specified array A. If such true values are not present in the array, return an empty array. Example 1: Python # Julia program to illustrate # the use of Array findall() method # Finding index of all true values from # the 1D array A A = [false, true, true, false] println(findall(A)) # Finding index of all true values from # the 2D array B of size 2 * 2 B = [false false; true false] println(findall(B)) # Finding index of all true values from # the 3D array C of size 2 * 2*2 C = cat([false false; true false], [false true; true false], [true false; true true], dims = 3) println(findall(C)) Output: Example 2: Python # Julia program to illustrate # the use of Array findall() method # Finding index of all even values from # the 1D array A A = [1, 2, 5, 7] println(findall(iseven, A)) # Finding index of all odd values from # the 2D array B of size 2 * 2 B = [3 5; 6 7] println(findall(isodd, B)) # Finding index of all odd values from # the 3D array C of size 2 * 2*2 C = cat([6 2; 6 4], [5 6; 2 8], [2 10; 11 1], dims = 3) println(findall(isodd, C)) Output: Comment More infoAdvertise with us Next Article Get all array elements with true values in Julia | Array findall() Method K Kanchan_Ray Follow Improve Article Tags : Julia Julia Array-functions Similar Reads Fill an array with specific values in Julia | Array fill() method The fill() is an inbuilt function in julia which is used to return an array of specified dimensions filled with a specific value passed to it as parameter. Syntax: fill(Value, Dimension)Parameters:  Value: To be filled in the arrayDimension: Required size of the array Returns: It returns an array 2 min read Checking for true values in an array in Julia - any() and all() Methods The any() is an inbuilt function in julia which is used to test whether any elements of the specified boolean collection are true and if any of the input value is 'missing', it will return missing if all non-missing values are false. Syntax: any(itr) Parameters: itr: Specified boolean collection. Re 2 min read Get index of last true value of array in Julia | Array findlast() Method The findlast() is an inbuilt function in julia which is used to return the index or key of the last true value in the specified array. Here values of index or key start from 1 i.e, for index of 1st element is 1, index of 2nd element is 2 and so on. Syntax: findlast(A) or findlast(predicate::Function 2 min read Get index of first true value of array in Julia | Array findfirst() Method The findfirst() is an inbuilt function in julia which is used to return the index or key of the first true value in the specified array. Here values of index or key start from 1 i.e, for index of 1st element is 1, index of 2nd element is 2 and so on. Syntax: findfirst(A) or findfirst(predicate::Func 2 min read Get next true value from a given array index in Julia | Array findnext() Method The findnext() is an inbuilt function in julia which is used to return the next coming index after or including i of a true element of the specified array A, or returns zero if true value is not found. Here values of index or key start from 1 i.e, for index of 1st element is 1, index of 2nd element 2 min read Like