Python | Sympy Permutation().array_form method Last Updated : 26 Aug, 2019 Comments Improve Suggest changes Like Article Like Report 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. Example #1 : In this example we can see that by using sympy.combinatorics.Permutation().array_form method, we are able to get the linear array from matrix or multidimensional array. # import sympy and Permutation from sympy.combinatorics.permutations import Permutation from sympy import * Permutation.print_cyclic = False # Using sympy.combinatorics.partitions.Permutation().array_form method gfg = Permutation([ [1, 2, 3], [21, 32, 44] ]) print(gfg.array_form) Output : [0, 2, 3, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 32, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 44, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 21] Example #2 : # import sympy and Permutation from sympy.combinatorics.permutations import Permutation from sympy import * Permutation.print_cyclic = False # Using sympy.combinatorics.partitions.Permutation().array_form method gfg = Permutation([ [1, 2], [3, 4], [5] ]) print(gfg.array_form) Output : [0, 2, 1, 4, 3, 5] Comment More infoAdvertise with us Next Article Python | SymPy Permutation.full_cyclic_form() method J Jitender_1998 Follow Improve Article Tags : Python SymPy Practice Tags : python Similar Reads 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 C/C++ Code # Python code explai 1 min read Python | SymPy Permutation.cyclic_form() method Permutation.cyclic_form() : cyclic_form() is a sympy Python library function that returns the cyclic notation from the canonical notation, by omitting the singletons. Syntax : sympy.combinatorics.permutations.Permutation.cyclic_form() Return : cyclic notation from the canonical notation Code #1 : cy 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 # Python code explaining # SymP 1 min read Python | SymPy Permutation.cardinality() method 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 # Python code explaini 1 min read Python | SymPy Permutation.full_cyclic_form() method Permutation.full_cyclic_form() : full_cyclic_form() is a sympy Python library function that returns the permutation in cyclic form, by including the singletons. Syntax : sympy.combinatorics.permutations.Permutation.full_cyclic_form() Return : permutation in cyclic form Code #1 : full_cyclic_form() E 1 min read Python | SymPy Permutation.commutator() method Permutation.commutator() : commutator() is a sympy Python library function that returns the commutator of the partition. Suppose 'a' and 'b' are part of 'C', then the commutator of a and b is the 'C' identity iff a and b commute, i.e. ab == ba. Syntax : sympy.combinatorics.permutations.Permutation.c 2 min read Python | SymPy Permutation.cycles() method Permutation.cycles() : cycles() is a sympy Python library function that returns the number of cycles present in the permutation. This also includes the singleton. Syntax : sympy.combinatorics.permutations.Permutation.cycles() Return : number of cycles present in the permutation Code #1 : cycles() Ex 1 min read 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.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.from_sequence() method Permutation.from_sequence() : from_sequence() is a sympy Python library function that returns the permutation which is required to obtain 'i' from the sorted elements of 'i'. A 'key' can also be passed as an argument if any custom string is required. Syntax : sympy.combinatorics.permutations.Permuta 2 min read Like