📜  Python|同情 as_ferrers() 方法

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

Python|同情 as_ferrers() 方法

借助sympy.combinatorics.IntegerPartition().as_ferrers()方法,我们可以使用sympy.combinatorics.IntegerPartition().as_ferrers()方法得到分区值的费勒图。

示例 #1:
在这个例子中,我们可以看到通过使用sympy.combinatorics.IntegerPartition().as_ferrers()方法,我们可以得到 ferrer 图。

# import sympy and IntegerPartition
from sympy.combinatorics.partitions import IntegerPartition
from sympy import *
   
# Using sympy.combinatorics.partitions.IntegerPartition().as_ferrers() method
gfg = IntegerPartition([1] + [2, 3]).as_ferrers()
   
print(gfg)

输出 :

示例 #2:

# import sympy and IntegerPartition
from sympy.combinatorics.partitions import IntegerPartition
from sympy import *
   
# Using sympy.combinatorics.partitions.IntegerPartition().as_ferrers() method
gfg = IntegerPartition([1] + [2, 3] + [4] + [5]).as_ferrers(char ='$')
   
print(gfg)

输出 :