Python | sympy Partition() method
With the help of sympy.combinatorics.partitions.Partition() method, we are going to separate the members of arrays into one tuple by using sympy.combinatorics.partitions.Partition() method.
Syntax :
sympy.combinatorics.partitions.Partition(array)Return : Return a members of arrays into one tuple.
Example #1 :
In this example we can see that by using
In this example we can see that by using
sympy.combinatorics.partitions.Partition() method, we are able to get the members of different arrays.
# import sympy and Relational from sympy.combinatorics.partitions import Partition from sympy import * x, y = symbols('x y') # Using from sympy.combinatorics.partitions.Partition() method gfg = Partition([1, 2], [4, 5, 6], [-12, -11]) print(gfg.members) |
chevron_right
filter_none
Output :
(-12, -11, 1, 2, 4, 5, 6)
Example #2 :
# import sympy and Relational from sympy.combinatorics.partitions import Partition from sympy import * x, y = symbols('x y') # Using from sympy.combinatorics.partitions.Partition() method gfg = Partition([3], [1, 91], [2], [6]) print(gfg.members) |
chevron_right
filter_none
Output :
(1, 2, 3, 6, 91)
Recommended Posts:
- Python | sympy.partition() method
- Python | SymPy Partition.sort_key() method
- SymPy | Partition.as_ferrers() in Python
- SymPy | Partition.RGS_unrank() in Python
- SymPy | Partition.RGS_rank() in Python
- SymPy | Partition.next_lex() in Python
- SymPy | Partition.conjugate() in Python
- SymPy | Partition.as_dict() in Python
- SymPy | Partition.RGS_enum() in Python
- SymPy | Partition.prev_lex() in Python
- SymPy | Partition.RGS_generalized() in Python
- Python | sympy.Add() method
- Python | sympy.rf() method
- Python | sympy.Pow() method
- Python | sympy.eye() 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.



