Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Python | sympy rank() method

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

With the help of sympy.combinatorics.Partition().rank method, we can get the rank of an array of subarrays that is passed as parameters in sympy.combinatorics.Partition().rank method.

Syntax : sympy.combinatorics.Partition().rank
Return : Return the rank of subarrays.

Example #1 :
In this example we can see that by using sympy.combinatorics.Partition().rank method, we are able to get the rank of array of subarrays.




# import sympy and Partition
from sympy.combinatorics.partitions import Partition
from sympy import * x, y = symbols('x y')
   
# Using sympy.combinatorics.partitions.Partition().rank method
gfg = Partition([1, 2], [4, 5, 6], [-12, -11])
   
print(gfg.rank)

Output :

119

Example #2 :




# import sympy and Relational
from sympy.combinatorics.partitions import Partition
from sympy import * x, y = symbols('x y')
   
# Using sympy.combinatorics.partitions.Partition().rank method
gfg = Partition([3], [1, 91], [2], [6])
  
print(gfg.rank)

Output :

47

My Personal Notes arrow_drop_up
Last Updated : 26 Aug, 2019
Like Article
Save Article
Similar Reads
Related Tutorials