Python | SymPy Permutation.cardinality() method Last Updated : 26 Aug, 2019 Comments Improve Suggest changes Like Article Like Report Permutation.cardinality() : cardinality() is a sympy Python library function that returns all the possible number of permutation. Syntax : sympy.combinatorics.permutations.Permutation.cardinality() Return : all the possible number of permutation Code #1 : cardinality() Example Python3 1=1 # Python code explaining # SymPy.Permutation.cardinality() # importing SymPy libraries from sympy.combinatorics.partitions import Partition from sympy.combinatorics.permutations import Permutation # Using from sympy.combinatorics.permutations.Permutation.cardinality() method # creating Permutation a = Permutation([[2, 0], [3, 1]]) b = Permutation([1, 3, 5, 4, 2, 0]) print ("Permutation a - cardinality form : ", a.cardinality) print ("Permutation b - cardinality form : ", b.cardinality) Output : Permutation a - cardinality form : 24 Permutation b - cardinality form : 720 Code #2 : cardinality() Example - 2D Permutation Python3 1=1 # Python code explaining # SymPy.Permutation.cardinality() # importing SymPy libraries from sympy.combinatorics.partitions import Partition from sympy.combinatorics.permutations import Permutation # Using from sympy.combinatorics.permutations.Permutation.cardinality() method # creating Permutation a = Permutation([[2, 4, 0], [3, 1, 2], [1, 5, 6]]) print ("Permutation a - cardinality form : ", a.cardinality) Output : Permutation a - cardinality form : 5040 Comment More infoAdvertise with us Next Article Python | SymPy Permutation.cardinality() method N noobestars101 Follow Improve Article Tags : Python SymPy Practice Tags : python Similar Reads Python | SymPy Permutation.index() method Permutation.index() : index() is a sympy Python library function that returns the index value of the permutation in argument. Index of a permutation = Sum of all subscripts j such that permutation[j] is greater than permutation[j+1]. Syntax : sympy.combinatorics.permutations.Permutation.index() Retu 1 min read Python | SymPy Permutation.atoms() method Permutation.atoms() : atoms() is a sympy Python library function that returns all the elements that are present in the permutation. Syntax : sympy.combinatorics.permutations.Permutation.atoms() Return : elements of the argumented permutation. Code #1 : atoms() Example Python3 1=1 # Python code expla 1 min read Python | SymPy Permutation.ascents() method Permutation.ascents() : ascents() is a sympy Python library function that returns the position of ascents in the permutation. Ascents are the elements where a[i] < a[i+1] Syntax : sympy.combinatorics.permutations.Permutation.ascents() Return : position of ascents in the permutation Code #1 : asce 1 min read Python | SymPy Permutation.array_form() method Permutation.array_form() : array_form() is a sympy Python library function that returns the 1 D copy of the augmented array. Syntax : sympy.combinatorics.permutations.Permutation.array_form() Return : copy of the Permutation in argument. Code #1 : array_form() Example Python3 # Python code explaini 1 min read Python | Sympy Permutation().array_form method With the help of sympy.combinatorics.Permutation().array_form method, we can get the linear array from multidimensional array or matrix by using sympy.combinatorics.Permutation().array_form method. Syntax : sympy.combinatorics.Permutation().array_form Return : Return an array having single dimension 1 min read Like