📜  SymPy | Python中的 Subset.rank_binary()

📅  最后修改于: 2022-05-13 01:54:58.668000             🧑  作者: Mango

SymPy | Python中的 Subset.rank_binary()

Subset.rank_binary() : rank_binary()是一个返回二进制排序等级的 sympy Python库函数。

代码 #1:rank_binary() 示例

# Python code explaining
# SymPy.Subset.rank_binary()
  
# importing SymPy libraries
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.subsets import Subset
  
# Using from 
# sympy.combinatorics.subset.Subsets.rank_binary()
  
# Creating Subset
a = Subset(['c', 'd'], ['geek', 'for', 'c', 'd'])
  
# rank_binary value
print ("Subset a rank_binary : ", a.rank_binary)

输出 :

代码 #2:rank_binary() 示例

# Python code explaining
# SymPy.Subset.rank_binary()
  
# importing SymPy libraries
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.subsets import Subset
  
# Using from 
# sympy.combinatorics.subset.Subsets.rank_binary()
  
# Creating Subset
a = Subset([2, 3, 4], [1, 2, 3, 4, 5])
  
# rank_binary value
print ("Subset a rank_binary : ", a.rank_binary)

输出 :