principia_materia.mathematics.array_utils module

principia_materia.mathematics.array_utils.array_in_2darray(arr1, arr2, tol=None)

Check if a 1D array is a sub-array of a 2D array.

principia_materia.mathematics.array_utils.index_array_in_array(arr1, arr2, tol=None, complete=True, return_both=False)

Find the indices for sub-arrays of arr1 in arr2.

Both arr1 and arr2 have same sub-arrays but in different order. This method finds the indices of these sub-arrays in arr2 to order them to the same ordering in arr1.