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]
Recommended Posts:
- Python | Sympy Line.is_parallel() method
- Python | sympy.GreaterThan() method
- Python | sympy.StrictLessThan() method
- Python | sympy.LessThan() method
- Python | sympy.StrictGreaterThan() method
- Python | sympy.ones() method
- Python | sympy.zeros() method
- Python | sympy.eye() method
- Python | Getting started with SymPy module
- Python | Sympy Ellipse.equation() method
- Python | Sympy Ellipse() method
- Python | sympy.combinatoric.Polyhedron() method
- SymPy | Prufer.rank() in Python
- SymPy | Prufer.size() in Python
- Python | sympy.trailing() method
- Python | sympy.multiplicity() method
- Python | sympy.perfect_power() method
- Python | sympy.factorint() method
- Python | sympy.smoothness() method
- Python | sympy.sec() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

