Subset.subset_indices() : subset_indices() is a sympy Python library function that returns the indices of subset in superset in a list
Syntax :
sympy.combinatorics.subset.Subset.subset_indices()Return :
the indices of subset in superset in a list
if all elements of subset are not in superset. – list is empty
Code #1 : subset_indices() Example
# Python code explaining # SymPy.Subset.subset_indices() # importing SymPy libraries from sympy.combinatorics import Permutation, Cycle from sympy.combinatorics.subsets import Subset # Using from # sympy.combinatorics.subset.Subsets.subset_indices() # superset super_set = [ 4 , 3 , 2 , 7 ] # Creating Subset a = Subset.subset_indices(([ 'geek' , 'for' , 'c' , 'd' ]), super_set) # subset_indices value print ( "Subset a subset_indices : " , a) |
Output :
Subset a subset_indices : []
Code #2 : subset_indices() Example
# Python code explaining # SymPy.Subset.subset_indices() # importing SymPy libraries from sympy.combinatorics import Permutation, Cycle from sympy.combinatorics.subsets import Subset # Using from # sympy.combinatorics.subset.Subsets.subset_indices() # superset super_set = [ 4 , 3 , 2 , 7 ] # Creating Subset a = Subset.subset_indices(([ 2 , 3 , 4 ]), super_set) # subset_indices value print ( "Subset a subset_indices : " , a) |
Output :
Subset a subset_indices : [2, 1, 0]