Python | sympy rank() method

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.



filter_none

edit
close

play_arrow

link
brightness_4
code

# 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)

chevron_right


Output :

119

Example #2 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# 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)

chevron_right


Output :

47



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

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.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.