Python中的SymPy Partition.as_ferrers()
Partition.as_ferrers() : as_ferrers()是一个sympy Python库函数,用于返回一个分区的ferrer图,正如提到的字符。
语法 : sympy.combinatorics.partitions.Partition.as_ferrers(char)
返回: 分区的费雷尔图
代码 #1 : as_ferrers() 示例
# Python code explaining
# SymPy.as_ferrers()
# importing SymPy libraries
from sympy.combinatorics.partitions import Partition
from sympy.combinatorics.partitions import IntegerPartition
# Using from sympy.combinatorics.partitions.Partition.as_ferrers() method
print(IntegerPartition([5, 2, 5]).as_ferrers())
代码 #2 : as_ferrers(char = ‘*’) 示例
# Python code explaining
# SymPy.as_ferrers()
# importing SymPy libraries
from sympy.combinatorics.partitions import Partition
from sympy.combinatorics.partitions import IntegerPartition
# Using from sympy.combinatorics.partitions.Partition.as_ferrers() method
print(IntegerPartition([1, 2, 3, 4]).as_ferrers(char = '*'))